This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Struts and the fly likes set value for a hidden field Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "set value for a hidden field" Watch "set value for a hidden field" New topic
Author

set value for a hidden field

Georg Joo
Ranch Hand

Joined: Feb 24, 2004
Posts: 49
Hi,

I want to fill a hidden field with a value from the resource file. But it doesn't work.
I get always a runtime error for the JSP File.

<html:hidden property="filenamesave" value="<bean:message key="path.pictures"/>" />

It this possible ? Or is there another way to set the value at runtime ?

Thanks


SCJP, SCWCD, SCBCD<br /> <br />Vienna, Austria
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4726

The problem is with placing one struts tag inside another. You can't do that.

Here's the good news: since you are setting the value of the hidden field yourself, you do not need the html:hidden tag because its only added value is in prepopulation... which you're doing yourself.

You can instead use:
<input type="hidden" name="filenamesave" value='<bean:message key="path.pictures"/>'/>

This will accomplish the equivalent of what you were attempting.


A good workman is known by his tools.
Georg Joo
Ranch Hand

Joined: Feb 24, 2004
Posts: 49
Hi,

I didn't knew that I can not use a struts tag inside another.

Thanks a lot for the information and help

Georg
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: set value for a hidden field
 
Similar Threads
how to avoid hedden field value displaying
Preventing multiple posts
how to get the value which changed by javascript in pagecode?
Form input type=hidden - is it possible to set values dynamically
portlet submit using javascript