In a similar vein, can anyone tell me where the code is to actually load the file?  
I'm having a similar problem, and I'd like to
see where the framework is TRYING to load the resource bundle from.

Thanks.

> Dear all,
>
> I'm trying to build my own (first) Struts application. I use the nightly
> build 20001130. Each time I try to open my second page after selecting a
> language on my first page, I get an error.
>
> *****
> Error 503
> Location /newWarrant/languageSwitch.do
> Cannot load application resources bundle warrantClasses.warrantResources
> *****
>
> Can somebody help me to solve this problem? I have been searching for a
> solution the last few hours but couldn't find one.
>
> Thanks in advance,
>
> Greetings,
>
> Koen De Smet
> [EMAIL PROTECTED]
>
>
>
>
> The other files, look like this:
>
> newwarrant/language.jsp:
> ------------------------
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/tlds/struts-form.tld" prefix="form" %>
>
> <form:html/>
> <form:base/>
>     <body>
>         <b>Choose your language</b><br>
>         <form:link page="/languageSwitch.do?l=fr"
> target="_top">French</form:link>&nbsp;&nbsp;&nbsp;
>         <form:link page="/languageSwitch.do?l=en"
> target="_top">English</form:link>&nbsp;&nbsp;&nbsp;
>         <form:link page="/languageSwitch.do?l=de"
> target="_top">Deutch</form:link>&nbsp;&nbsp;&nbsp;
>     </body>
> </html>
>
> newwarrant/WEB-INF/struts-config.xml:
> -------------------------------------
> <struts-config>
> ...
>   <action-mappings>
>     <!-- Edit user registration -->
>     <action    path="/languageSwitch"
>                type="warrantClasses.action.LanguageSwitch"
>                name="languageSwitch"
>               scope="request">
>     </action>
>
>     <!-- The standard administrative actions available with Struts -->
> ...
>   </action-mappings>
>
> </struts-config>
>
> newwarrant/WEB-INF/web.xml:
> ---------------------------
>
> <web-app>
> ...v
>   <!-- Action Servlet Configuration -->
>   <servlet>
>     <servlet-name>action</servlet-name>
>     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>     <init-param>
>       <param-name>application</param-name>
>       <param-value>warrantClasses.warrantResources</param-value>
>     </init-param>
>     <init-param>
>       <param-name>config</param-name>
>       <param-value>/WEB-INF/struts-config.xml</param-value>
>     </init-param>
> ...
>   </servlet>
>
>   <!-- Action Servlet Mapping -->
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>*.do</url-pattern>
>   </servlet-mapping>
>
> ...
>   <!-- Struts Tag Library Descriptors -->
> ... (5 struts-taglibs)
> </web-app>
>
> in newwarrant/WEB-INF/classes/warrantClasses:
> ---------------------------------------------
> 3 propertiesfiles
> warrantResources.properties
> warrantResources_fr.properties
> warrantResources_de.properties
>
> in newwarrant/WEB-INF/lib:
> --------------------------
> hitjdbc.jar
> strauts.jar
> warrantdb.jar
>
> in newwarrant/WEB-INF/lib:
> --------------------------
> 5 Struts tld's
> struts-config_1_0.dtd
>
> newwarrant/WEB-INF/classes/warrantClasses/action/LanguageSwitch.java:
> ----------------------------------------------------------------------
> package warrantClasses.action;
>
> import java.sql.*;
> import java.util.*;
> import warrant.db.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import org.apache.struts.util.*;
> import org.apache.struts.action.*;
>
> public class LanguageSwitch extends Action
> {
>     public static final String LANGUAGE = "l";
>     public static final String ENGLISH = "en";
>     public static final String FRENCH = "fr";
>     public static final String GERMAN = "de";
>
>     public ActionForward perform(ActionMapping mapping, ActionForm form,
> HttpServletRequest request, HttpServletResponse response)
>     {
>         ActionForward forward = null;
>
>         // process language parameter
>         Locale locale = null;
>         String language = request.getParameter(LANGUAGE);
>
>         if (language.equals(FRENCH)) {
>             locale = Locale.FRENCH;
>         } else if (language.equals(GERMAN)) {
>             locale = Locale.GERMAN;
>         } else {
>             locale = Locale.ENGLISH;
>         }
>
>         HttpSession session = request.getSession();
>         session.setAttribute(Action.LOCALE_KEY, locale);
>
>         //set up the warrant manager for this session
>         WarrantManager mgr = new WarrantManagerImpl();
>         try {
>
>             mgr.openDBConnection();
>             session.setAttribute("warrantmanager", mgr);
>
>             forward = new ActionForward("/main.html");
>         } catch(Exception e) {
>             request.setAttribute("javax.servlet.jsp.jspException", e);
>             forward = new ActionForward("/error.jsp");
>         }
>
>         return forward;
>     }
> }
>
> ************************************************************************
> The information in this email is confidential and is intended solely
> for the addressee(s).
> Access to this email by anyone else is unauthorised. If you are not
> an intended recipient, you must not read, use or disseminate the
> information contained in the email.
> Any views expressed in this message are those of the individual sender,
> except where the sender specifically states them to be the views of
> The Capital Markets Company.
>
> http://www.capco.com
> ***********************************************************************
>

Reply via email to