jQuery in Action, 3rd edition
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Question." Watch "Struts Question." New topic

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
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.


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>"
input="<input jsp >"

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