[struts] Problems in printing an Integer

H

Hamvil

Hi,

I have strange problem in using the tag bean:write. I'm trying to
migrate from sdtruts 1.1 to struts 1.2.9.

In the action I have the following code:

httpServletRequest.getSession().setAttribute("tmp", new Integer(123));

In the correspondat jsp I have

<bean:write name="tmp" />

HOwever this results in an empty page (i can guess that is because
struts cannot find the variable)). Instead if I do the following
everything works fine:

<bean:define id="xyz" name="tmp" />
<%=xyz%>

So I have two question:

1) why I get the blank page instead of the usual exception in the jsp
page?
2) why the variable cannot be printed?

Thanks
 
H

Hamvil

Hamvil ha scritto:
1) why I get the blank page instead of the usual exception in the jsp
page?

Ok, I've fixed this (it was a problem with the configuration of the
logger
2) why the variable cannot be printed?

In the logger i get the following message:

javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE

What I do not understand is why struts looks for a key in the resources
file. It should just print the integer. Am I missing somethink?

BTW if I add the following in the struts-config the problem look fixed.
Is this the right approach?

<message-resources
parameter="MyWebAppResources"
null="false" />

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top