I'm building my first struts App and would appreciate some help with
the following:
Currently I have a JSP with the following code:
<jsp:useBean id="nameForm" class="com.myapp.NameForm" scope="session"/>
<jsp:setProperty name="nameForm" property="surname" value="bob" />
***
SUMMARY: Essentially I want to be able to replace the above two lines
with a struts tag where I don't have to give it the class name, because
my bean is already defined in struts-config hence struts knows the
class. Is there such a thing or is the above the recommended way ?
More details follow.
***
<html:link forward="viewdetails">View details</html:link>
This is in the struts-config as follows:
Bean:
<form-bean name="nameForm" type="com.myapp.NameForm" />
Global forward:
<forward name="viewdetails" path="/admin/nameadmin.do?action=view" />
Action:
<action path="/admin/nameadmin"
type="com.myapp.NameAdminController"
name="nameForm"
scope="session"
input="/admin/admin_list_names.jsp" >
</action>
The NameAdminController uses the 'surname' as a key into the db to
load the details.
This works fine, but it means I have the name of the class in my
struts-config and in my JSP. Struts already knows the class for
'nameForm' so I'm hoping for a tag of the form:
<bean:set name="nameForm" property="surname" value="bob" />
Is there such a thing ?
There is a <bean:define> tag but it seems to want my nameForm to be a
String.
Many thanks,
Graham King.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>