Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

[struts] Problems in printing an Integer

Thread view: 
Hamvil - 09 Oct 2006 16:54 GMT
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
Hamvil - 10 Oct 2006 14:44 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.