File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Doubt in Bean Details display 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 "Doubt in Bean Details display" Watch "Doubt in Bean Details display" New topic

Doubt in Bean Details display

Divakar Sashwanth

Joined: Apr 17, 2005
Posts: 11

I am new to struts.. I am trying to learn the flow of a struts application... I am caught up with a problem.

I have a actionform, action class and a bean. In the action class i query for the details from the database and set it the values to the bean abd then redirect to an another page(confirmation.jsp). In the confirmation.jsp i need to display the values of the bean which are assigned in the action class. How will i do it... i tried using the bean:write tag.. but i came with errors and i am still trying on it.. Can u please hel pme in this..

I have atatched my code below.. please help me... weaiting for ur reply..

Member Bean

public class Member {

private String emailID;
private String firstName;

// all the getters and setters for the member bean


Action Class

public class EntryAction extends Action {
public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm,
HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {

EntryForm entryForm = (EntryForm)actionForm;
Member member = null;
String target = "success";
String emailID = "";
String firstName = "Ram";

member = new Member();
httpServletRequest.setAttribute("member", member);

return actionMapping.findForward(target);


<%@ taglib uri="struts/bean-el" prefix="bean" %>
<%@ taglib uri="struts/html-el" prefix="html" %>
<%@ taglib uri="struts/logic-el" prefix="logic" %>

<jsp:useBean id="member" scope="request" class="Member"/>

<bean:write name="member" property="emailID" />

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Please post the error message you're getting.

One thing I can see right away is that you need to put all the java classes you create in packages. Classes in the default package don't do well in web applications.

Consultant, Sima Solutions
Vasudhaiv Naresh
Ranch Hand

Joined: May 13, 2005
Posts: 57
can u paste the stack trace.
I think there's a problem with th eproperty emailID in the bean.
I agree. Here's the link:
subject: Doubt in Bean Details display
jQuery in Action, 3rd edition