• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Very basic question

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All

I have very simple problem. I am not able to get <bean:message key="title.login"/> working.

I have following configuration.

struts 1.2.9
Tomcat 5.5

My web.xml is like

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

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"

<display-name>Struts Blank Application</display-name>

<!-- Standard Action Servlet Configuration (with debugging) -->

<!-- Standard Action Servlet Mapping -->

<!-- The Usual Welcome File List -->

<!-- Struts Tag Library Descriptors -->






My strus-config.xml is like

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

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"


<!-- ========== Form Bean Definitions ============ -->
<form-bean name="login" type="org.apache.struts.validator.DynaValidatorForm" />
<form-property name="userId" type="java.lang.String" />
<form-property name="passWord" type="java.lang.String" />


<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"

<!-- ========== Global Forward Definitions ========= -->

<!-- ========== Action Mapping Definitions ======== -->
type="test.struts.LoginAction" >

<forward name="valid" path="/jsp/MainMenu.jsp" />
<forward name="invalid" path="/jsp/LoginView.jsp" />


My jsp goes like this

<!-- LoginView.jsp -->

<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<bean:message key="title.login"/>
<BODY><p> This is very very bad.
<bean:message key="title.login"/>

I just wanted <baen:message>

I get following error


org.apache.jasper.JasperException: Exception in JSP: /jsp/First.jsp:8

5: <HTML>
6: <HEAD>
7: <TITLE>
8: <bean:message key="title.login"/>
9: </TITLE>
10: </HEAD>
11: <BODY><p> This is very very bad.


My message.properties is like

button.submit=Send for Verification
error.no.userId=<li>User ID is a required field</li>
error.no.passWord=<li>Password is a required field</li>
error.invalid.login=<li>The User ID and/or Password are invalid. Please try again.</li>
errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
label.userId=User ID
heading.login=<H2>Enter your user information</H2>
title.login=Login Screen
label.userType=<H2>You are authorized to use this system as a</H2>
errors.required={0} is required.<br>
errors.minlength={0} cannot be less than {1} characters<br>

Where am I going wrong? I think taglibs entries are finding the required tld files in my WEB-INF but <bean:message> not working? Please guide.

Madhuri Dhahiwal
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From what you've shown us of your struts-config.xml file, you haven't configured the message resources. You need an entry like this:

<message-resources parameter="message"/>

You also need to make sure your message.properties file is in /WEB-INF/classes.

This link has a lot of good information about all aspects of messages in Struts.
Madhuri Dhahiwal
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks it is really working now.

Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am using jsp and display tag. when am using java script its giving error.
could no process the requestorg.apache.jasper.JasperException: /web/viewdata.jsp(5,5) Invalid standard action

Can anyone help me.. Thanks in advance
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic