*
The moose likes Other Application Frameworks and the fly likes localisation problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "localisation problems" Watch "localisation problems" New topic
Author

localisation problems

krishna Gajarla
Greenhorn

Joined: Oct 02, 2005
Posts: 21
Hi,

I have written

TestController.java

package com.egatematrix.ess.controller.model;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

import org.springframework.web.servlet.*;
import org.springframework.web.servlet.mvc.*;

public class TestController implements Controller
{
public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse res) throws Exception
{
System.out.println("1");
return new ModelAndView("Home", "message", greeting);
}
private String greeting;

public void setGreeting(String greeting)
{
this.greeting=greeting;
}
}


index.jsp:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<c:redirect url="/home.htm"/>

web.xml:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

<servlet>
<servlet-name>cbtech</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>cbtech</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>

messages.properties:

success=You are a Valid User

cbtech-servlet.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
<bean name="/home.htm" class="com.egatematrix.ess.controller.model.TestController">
<property name="greeting">
<value>Welcome to Cybertech</value>
</property>
</bean>

<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>messages</value>
<value>buttons</value>
</list>
</property>

</bean>

<bean id="localeResolver" class="org.springframework.web.servlet.i18n.KookieLocaleResolver"/>

<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>

</bean>
</beans>


Home.jsp:

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>

<html>
<head><title>Spring Training, Inc.</title></head>
<body>
<h2><fmt:message key="success"/></h2>
<input type=submit class="button" value="<fmt:message key="submit"/>">
</body>
</html>


In the above code i have miss spelt Cookie as Kookie.

Can any one help me. And also i want to use Hyperlinks to change locales in jsp using interceptors. Can anyone give me the code.

Thanks in advance

Radha Krishna


Thanks and Regards,<br />krishna<br />------------------<br />Charles Darwin: <br />"It is not the strongest of the species that survives, <br />nor the most intelligent, <br />but the one most responsive to change"
 
 
subject: localisation problems
 
Similar Threads
Does Spring framework supported by godaddy shared linux hosting
Spring exception Neither BindingResult nor plain target object for bean name 'name' a
DispatcherServlet vs ContextLoaderListener?
Spring
Problem deploying spring in Tomcat 6