I started out my knowledge of Struts with "Jakarta Struts for Dummies" and they have a sample application called "Music List Collection" that I am basing some this on.

Basically, all I want to do is get a list of data displayed on the screen. If I include a submit button and hit it, then the action is called, the bean is called, a collection of data is returned, that collection is put into the session into the Action Servlet. And then we iterate through the data to display this information on the screen.

The form is not a form where the user is entering data ... however, we may want to add a record, we may want to delete a record, or we may want to select a record for editing, all depending on what SUBMIT button we click on. So, that is the reason we have a form ... so that when we call the Action Servlet, that it determines what functionality we are doing. Hence when we first call this form ... there doesn't need to do any validation.

In my limited knowledge of Struts ... in order to execute this action which gets my data, it requires a submit to call the action.

So, I have a default.jsp page with 3 imports simply by using <c:import> tags.

<body>
        <c:import url="/myapp/includes/header.jsp" />
        <c:import url="/myapp/includes/listdata.jsp" />
        <c:import url="/myapp/includes/footer.jsp" />
</body>

The "listdata.jsp" has 3 taglibs included, a resource bundle and then we have:

<html:form action="listdata.do"
        <html:hidden value="">
        <html:submit />
</html:form>

With these imports, the default page loads in all three pages and the listdata.jsp also loads ... but without calling the action first. So, I tried something like this:

<body>
        <c:import url="/myapp/includes/header.jsp" />
        <c:import url="/myapp/includes/listdata.do" />
        <c:import url="/myapp/includes/footer.jsp" />
</body>

I figured this way, the action would be called whenever we come back to default.jsp. But it seems like I get a JasperException Error when this happens. Maybe what I did was an infinite loop because it kept calling the listdata.do and when it's done, the struts-config.xml says to go back to default.jsp.

So, again, I want to display a list of data from the database when the page is first called ... then I'll have the choice to choose a record for updating, deleting, viewing, or adding a new record ... and then go back to the list page so I can see the new record added.

I hope this helps with explaining what I am trying to do. Thanks for you help.

                   Tom


Michael McGrady wrote:

Tom Holmes Jr. wrote:

I have a webpage




Wendy is right. We really need to know what you are trying to achieve because an automatic submission of a form makes no apparent sense. When you say middle "page" do you mean like a tile?
Michael



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to