• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Tiles with the submit form

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question -> running the application with tiles classic layout it is working fine.
now clicking on the Search the Search page getting displayed

when user press submits the query on "Search page" want to navigate to --> "Result.jsp" OR "NoResult.jsp"
but both jsp [ "Result.jsp" OR "NoResult.jsp" ] should be displayed in the body part of the tiles
i can't figure out how to do it below is my working code.
that is how to submit the request so it gets displayed using tiles



--------------------linkAction.java-------------------

---------------------------------Menu.jsp----------------------

---------------------------------Struts-config.xml--------------------

-------------------------------------and the tiles-defs.xml------------------------------



Thanks in Advance.....
====================
 
Ranch Hand
Posts: 213
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From your question I don't know if you are having a problem calling an action to return the result or a problem display the result or noresult pages so I'll cover it all.

I've done this in Struts 2 and not Struts 1 so I'm doing some guessing here.
First, in your action mapping you need another forward defined for the results/no results page.
So your action mapping should look something like this

# <action path="/Link" parameter="method" type="com.LinkAction">
# <forward name="search" path= "Search.page" />
# <forward name="result" path= "Result.page" />
# </action>

Assuming that when you click on the search button you return to the search method, you need to check if the search button was clicked to determine if you are supposed to do the search and forward to the results page or forward to the search page.

That would be something like the following:

String buttonPressed = request.getParameter("search"); //assuming that "search is the property value of your submit button
if (buttonPressed != null) {
//do search stuff here
//return mapping.findForward("result");
}
else{
return mapping.findForward("search");
}
Finally, in the body.jsp page do a conditional include to display either the results.jsp or noresults.jsp page.
 
akshit kumar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Richard Golebiowski wrote:From your question I don't know if you are having a problem calling an action to return the result or a problem display the result or noresult pages so I'll cover it all etc. ...............................................................................................................


I think I didn't phrased the question right so you misunderstood me anyways for other here is the solution for any page to be displayed in your tiles
if that a jsp page is getting called from other jsp say on submission of login.jsp page
you need to do two things notice the name "login.success" below
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic