Search Results

Search found 3 results on 1 pages for 'aelshereay'.

Page 1/1 | 1 

  • Character-encoding problem spring

    - by aelshereay
    Hi All, I am stuck in a big problem with encoding in my website! I use spring 3, tomcat 6, and mysql db. I want to support German and Czech along with English in my website, I created all the JSPs as UTF-8 files, and in each jsp I include the following: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> I created messages.properties (the default which is Czech), messages_de.properties, and messages_en.properties. And all of them are saved as UTF-8 files. I added the following to web.xml: <filter> <filter-name>encodingFilter</filter-name> <filterclass> org.springframework.web.filter.CharacterEncodingFilter</filterclass> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <locale-encoding-mapping-list> <locale-encoding-mapping> <locale>en</locale> <encoding>UTF-8</encoding> </locale-encoding-mapping> <locale-encoding-mapping> <locale>cz</locale> <encoding>UTF-8</encoding> </locale-encoding-mapping> <locale-encoding-mapping> <locale>de</locale> <encoding>UTF-8</encoding> </locale-encoding-mapping> </locale-encoding-mapping-list> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> And add the following to my applicationContext.xml: <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource" p:basenames="messages"/> <!-- Declare the Interceptor --> <mvc:interceptors> <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="locale" /> </mvc:interceptors> <!-- Declare the Resolver --> <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" /> I set the useBodyEncodingForURI attribute to true in the element of server.xml under: %CATALINA_HOME%/conf, also another time tried to add URIEncoding="UTF-8" instead. I created all the tables and fields with charset [utf8] and collection [utf8_general_ci] The encoding in my browser is UTF-8 (BTW, I have IE8 and Firefox 3.6.3) When I open the MYSQL Query browser and insert manually Czech or German data, it's being inserted correctly, and displayed correctly in my app as well. So, here's the list of problems I have: By default the messages.properties (Czech) should load, instead the messages_en.properties loads by default. In the web form, when I enter Czech data, then click submit, in the Controller I print out the data in the console before to save it to db, what's being printed is not correct having strange chars, and this is the exact data that saves to db. I don't know where's the mistake! Why can't I get it working although I did what people did and worked for them! don't know.. Please help me, I am stuck in this crappy problem since days, and it drives me crazy! Thank you in advance.

    Read the article

  • getting data problem with MYSQL under linux

    - by aelshereay
    Hi all, Recently I started to use Linux (Ubuntu 9.10) instead of windows. I am working on a java web application with Spring, MYSQL with jpa. However, before to install linux I made a backup file from the database, then installed linux, installed the MYSQL Query Browser and Administrator tools, and using the Admin tool restored the backup file, then got all the tables and made a simple select statement from one of the tables and got result normally and everything seems to work just fine. There a USER table, and there's a namedQuery defined to get a user by userName, the problem is that when I pass a correct userName I still get nothing! I really don't know what is the problem! The application was working perfectly under windows! Please, can anyone help me to solve this problem? Thank you in advance.

    Read the article

  • java.lang.ClassNotFoundException: org.springframework.ui.ModelMap

    - by aelshereay
    I create a simple webapp using tomcat 6, spring 2.5.6 and maven. The problem is when I boot up tomcat, I am getting the following errors: SEVERE: StandardWrapper.Throwable java.lang.NoClassDefFoundError: org/springframework/ui/ModelMap ... Caused by: java.lang.ClassNotFoundException: org.springframework.ui.ModelMap The ModelMap class does exist in spring-2.5.6.jar and spring-context-2.5.6.jar, I also have some other spring jars. All of them are being deployed to tomcat correctly, when I check the application WEB-INF (deployed to tomcat) I found all those jars there! I have only one @Controller that has a @RequestMapping("/home.htm") showForm(ModelMap model) method. My applicationContext is quite simple: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd" default-autowire="byName"> <context:component-scan base-package="org.myapp"/> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property> <property name="prefix" value="/WEB-INF/view/"></property> <property name="suffix" value=".jsp"></property> </bean> </beans>

    Read the article

1