• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Tiles with the submit form

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Good heavens! What have you done! Here, try to fix it with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!