File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts Question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Question." Watch "Struts Question." New topic
Author

Struts Question.

Rohit Ahuja
Ranch Hand

Joined: Oct 04, 2001
Posts: 121
Hi guys,
Need a small help and a real quick one, since i just began to get my hands on struts still am not very comfortable with the framework.
Coming to my problem. I want to know how do i get a Form class on my jsp page.
Explaining it in detail :

I have a page A, on submitting page A i am supposed to go to page B.
I have written a code like
request.getSession().setAttribute("B_FORM",b_form);
in the A_Action class.
When my control comes to page B, i need to use the b_form thing on my page directly.
It works if i use :
<html:text name="B_FORM" property="xyz" size="3" maxlength="3" style="ime-mode isabled;"/>
in B.jsp(xyz being a field on my page).
However the value is not populated in the textfield if i use
<html:text property="xyz" size="3" maxlength="3" style="ime-mode isabled;"/>

I actually want to use the second case as my control might return back to the same page and at that time i do not want session values.
What do i do to get this working ?
I need the solution real quick mates.

Thanks...


Face Off.
Harish Kashyap
Ranch Hand

Joined: Jun 14, 2000
Posts: 118
Make use of <form-bean>...</form-bean> configuration in struts-config.xml

u got to write a bean class representing the html form. And configure it in struts-config.xml as follows

<action path="<action path>"
type="<Action class>"
name="<form name>"
scope="request"
input="<input jsp >"
validate="false">
</action>

<form-bean name="<form name>" type="<form bean class>"/>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Question.