Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not displaying value in a text fields

Status
Not open for further replies.

lcky

Programmer
Sep 29, 2005
30
0
0
GB
Hi
I have a jsp page display my project information. The displayProject.jspe get displayed, by calling displayProject.do action. This action populate projectActionForm. This ProjectActionForm has get and set method for projecttitle. I have also defined in struts-config.xml .

I have edit button on this page. When I click this button, it called displayProjectForUpdate.do action. This display displayProjectEdit.jsp in edit mode and should have value for projecttitle.

For reason, it is not display projecttitle value.

eg
<html:form>
<html:text property="projecttitle" />
</html:form>

It is displaying the field, but it is empty. There is no projecttitle value in the field.

<form-beans>
<form-bean name="projectActionForm"
type="org.view.ProjectActionForm"/>
</form-beans>

<action path="/displayProject"
type="org.view.FindProjectAction"
name="projectActionForm"
scope="session"
input="/jsp/displayProjects.jsp">
<forward name="success"
path= "/jsp/displayProject.jsp" />
</action>

<action path="/displayProjectForUpdate"
type="org.view.SuccessAction"
name="projectActionForm"
scope="session"
input="">
<forward name="success"
path= "/jsp/displayProjectEdit.jsp" />
</action>

Please could you help.

Many thank
 
Hi,

In the displayProject.jsp the projecttitle is displayed but when u click the edit button it forwards to another edit action and in that page projecttitle is not displayed.

Am I correct?

If it is correct set the projecttitle value in session object in the Action(displayProject.do)class.
execute(.....)
{
HttpSession session = request.getSession();
session.setAttribute("projectTitle",formName.getProjectTitle());
}
In Edit JSP type
<html:text property="projecttitle" value=<%=session.getAttribute("projectTitle").toString()%>/>

Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top