UTF-8 problems in Grails 2.4 with russian lang - eclipse

I started a new project in grails 2.4 version and when I write something in russian into gsp files, browser render the page with uncorrect symbols. in gsp files I have charset=utf-8 and <%# page contentType="text/html;charset=UTF-8" %> this line. in Config.groovy
grails {
views {
gsp {
encoding = 'UTF-8'
htmlcodec = 'xml'
codecs {
expression = 'html'
scriptlet = 'html'
taglib = 'none'
staticparts = 'none'
}
}
}
}
and I change encoding to UTF-8 for whole project in Eclipse Project properties. what is wrong, please, help.

I found the solution and the problem was with tomcat. I changed tomcat configuration fot utf-8

Related

How to use tinylog in Eclipse plugin

I am writing an Eclipse plugin and want to use tinylog in my plugin code. I tried this:
1). modified Eclipse config file (eclipse.ini) to add this line:
-Dtinylog.configuration=C:\eclipse-cpp-2018-09-win32-x86_64\eclipse\tinylog.properties
2). content of tinylog.properties:
writer = file
writer.level = debug
writer.file = C:\eclipse-cpp-2018-09-win32-x86_64\eclipse\log.txt
writer.charset = UTF-8
writer.append = true
writer.buffered = true
After launching Eclipse and run my plugin, I couldn't see log.txt
BTW, my tinylog version is of 1.3.6
You are using tinylog 1 with a configuration for tinylog 2. The correct configuration for tinylog 1.3.6 would be:
tinylog.writer = file
tinylog.writer.level = debug
tinylog.writer.filename = C:\eclipse-cpp-2018-09-win32-x86_64\eclipse\log.txt
tinylog.writer.buffered = true
tinylog.writer.append = true
In tinylog 1.3.6, the charset cannot be defined in the configuration. Instead, tinylog 1 will use the default charset for your system. The manual for tinylog 1 can be found here: https://tinylog.org/v1/configuration
Update: I just uploaded a working minimal example project on GitHub: https://github.com/pmwmedia/tinylog-eclipse-plugin-example. It contains an Eclipse plug-in that uses tinylog 1.3.6 as logging framework.

Adding class attribute to HTML Tag in TYPO3 9.x or access the config.yaml configuration in typoscript?

In my TYPO3 9.5 LTS project i want the follwoing HTML Tag rendered:
<html dir="ltr" lang="de" class="no-js">
In previous TYPO3 Settings, i could configure this by the typoscript:
page.config.htmlTag_setParams = dir="ltr" lang="{$config.language}" class="no-js"
But in TYPO3 9.5, the language settings are defined in the config.yaml file. Without the typoscript setting above, the html tag will render the correct dir attribute and lang attributt. But if i try to add the class attribute like this:
page.config.htmlTag_setParams = class="no-js"
the lang and dir attribute will be overwritten.
Is there a way to just add the class attribute without removing the lang and dir attribute?
Can i access the yaml configurations in typoscript setup?
This will be possible as soon as 9.5.2 has been released because of the feature https://review.typo3.org/#/c/58976/

JSP <jsp:include /> vs <%# include %> when concatenating with a variable

I am new to Java and JSP. I am trying to use eclipse Mars.1 to create a JSP application to see how it compares to using NetBeans 8 IDE.
In NetBeans 8 the following worked to include a file where "action" holds the name of the desired file.
<jsp:include page="<%= "/views/"+session.getAttribute("action")+".jsp" %>"/>
In eclipse Mars.1 this same line gives this error in the browser.
(line: 16, column: 25) Attribute value "/views/" + session.getAttribute("action") + ".jsp" is quoted with " which must be escaped when used within the value
To solve this issue I attempted to use
<%# include file="/views/" + ${sessionScope.action} + ".jsp" %>
I found out some information that using the JSP EL the + is always a math function.
How would I accomplish using the variable sessionScope.action to build a string for the file attribute?

Unicode characters in Javadoc [duplicate]

I am trying to generate Java documentation in Eclipse. The source files are UTF-8 encoded and contain some umlauts. The resulting HTML files do not specify an encoding and do not use HTML entities, so the umlauts aren't displayed correctly in any browser.
What can I do to change this?
Modified from Eclipse javadoc in utf-8:
Project -> Generate Javadoc -> Next -> on the last page, in Extra Javadoc options write:
-encoding UTF-8 -charset UTF-8 -docencoding UTF-8
See the -charset, -encoding and -docencoding flags for the javadoc command.
-encoding specifies the input encoding
-docencoding specifies the output encoding
-charset makes javadoc include a meta tag with encoding info
If you generate your javadoc with an ant task and you use UTF-8 you can do:
<javadoc encoding="UTF-8" charset="UTF-8" docencoding="UTF-8" sourcepath="yoursources" destdir="yourdocdir" />
When generating the javadoc with Gradle add the following to your build.gradle file:
javadoc {
options.encoding = 'UTF-8'
options.docEncoding = 'UTF-8'
options.charSet = 'UTF-8'
}

Eclipse Tomcat integration: useBean class attribute [class] is invalid

I'm using Eclipse Juno (Java EE) and Tomcat 7.0. I've successfully connected Tomcat and Eclipse with this tutorial: http://www.mulesoft.com/tomcat-eclipse
JSTL and *.jsp files are working well within Eclipse and Tomcat but I can't use JavaBeans.
I store my JavaBeans in /WebContent/WEB-INF/classes/com/form.
In the *.jsp File (which is in /WebContent) I use the following code:
<%# taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%# page import="com.form.*" %>
...
<jsp:useBean id="input" class="com.form.Input"/>
Input.java:
package com.form;
public class Input {
private String firstName;
private String lastName;
private String gender;
private boolean vegetarian;
public Input() {
this.firstName = new String();
this.lastName = new String();
this.gender = new String();
}
...
When I run this application I get the following error message:
The value for the useBean class attribute com.form.Input is invalid
I don't want to post the whole code but you can download the complete Eclipse project here: https://dl.dropbox.com/u/6454333/BeanForm.zip
I hope you can help me.
Thank you and good bye
konze
You're confusing source files and class files.
WebContent is the place, in Eclipse, where you put the resources of the webapp (html files, images, css files, jsp files, etc.). There shouldn't be anything under WebContent/WEB-INF/classes. No .java file. No .class file.
When building the application with Eclipse, Eclipse will compile all the .java files in the project source directory, and the generated .class files will be part of the runtime classpath of the deployed web application.
If you generate a war file from eclipse, it will contain a WEB-INF/classes directory which will contain the .class file it has generated when compiling the source files from the project source directory.