This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes [Struts2] dinamic name for textfield Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "[Struts2] dinamic name for textfield " Watch "[Struts2] dinamic name for textfield " New topic

[Struts2] dinamic name for textfield

kevin hack

Joined: Jun 20, 2011
Posts: 6
Hi all,

I need pass dinamic name at textfield tag.

For example:
<s:textfield name="<%=request.getParameter("type")%>.myField" maxlength="250" size="20px;"/>

Is it possible?

My Action contains these objects:
MyBean myBean1 = new MyBean();
MyBean myBean2 = new MyBean();

his name is generic, type can be myBean1 or myBean2

MyBean class contains myField attribute

Help please

Thanks in advance
I agree. Here's the link:
subject: [Struts2] dinamic name for textfield
Similar Threads
Why ModelDriven not working?
Help reqd. in displaying results
Is there a way to put data form a jsp to a form field?
Accessing javabean in JSP which is instantiated in Action class
A JSP consisting of a single jsp:useBean won't compilef