permaculture playing cards
The moose likes Struts and the fly likes Help required on HelloWorld Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help required on HelloWorld" Watch "Help required on HelloWorld" New topic

Help required on HelloWorld

Mohana Priya
Ranch Hand

Joined: Jan 16, 2005
Posts: 45
Hi All ,
I am trying out my first Struts Application

This is my file :

; Application Resources for the "Hello" sample application
; Application Resources that are specific to the hello.jsp file

hello.jsp.title=Hello - A first Struts program World! A first Struts application
hello.jsp.prompt.person=Please enter a name to say hello to :

; Validation and error messages for and told you not to talk to Atilla!!! enter a <i>PERSON</i> to say hello to!


I am able to get the Validation and error messages .

But problem in displaying ( bold ones ) using bean:message tag in the page.

I have struts-bean.tld in WEB-INF folder and <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> in my jsp file .

I have given an entry in struts-config.xml as

<message-resources parameter="ApplicationResources"/>

And placed the \WEB-INF\classes .

Am I missing out something ??

Thanks in Advance,
Mohana Priya

SCJP 1.4<br />SCWCD 1.4
santhoshkumar samala
Ranch Hand

Joined: Nov 12, 2003
Posts: 156

I think u better declare taglib in web.xml also

santhosh<br />SCJP,SCWCD
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Show us how you are trying to access the messages in your JSP.

Consultant, Sima Solutions
Mohana Priya
Ranch Hand

Joined: Jan 16, 2005
Posts: 45

Accessing the messages in jsp .
<bean:message key=""/>

Dont know what exactly solved the problem.It is working fine now.

Thanks for the replies,
Mohana Priya

SCJP 1.4 (95%)
SCWCD 1.4 (86%)
vijay saraf
Ranch Hand

Joined: Jan 08, 2005
Posts: 141
Perhaps you have coded like

1) In web.xml :

2) In config.xml : for application resources
<message-resources parameter="com.myapp.struts.ApplicationResource"/>
3)In hello.Jsp :

3.a ) for include :
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
3.b) for display :
<bean:message key="aap.welcome.heading"/>

if you have not done this way.......
it will be better if starts with netbeans or eclipse IDEs.

Vijay Saraf.
I agree. Here's the link:
subject: Help required on HelloWorld
It's not a secret anymore!