-
Jan 2nd, 2008, 08:40 AM
#1
method call at jsp page beginning
Hi,
Kindly clarify the below doubts.
I have main Page (say parentPage.jsp) which includes the second page called childPage.jsp.All the values to be displayed in parentPage.jsp are fetched from the db(put in map) and i returned the pagename(parentPage.jsp) and map from my controller.While including the second page is there any chance to call another methods without submitting the page.
ie.. any possiblity to call method at the beginning of the page after include
-
Jan 2nd, 2008, 08:47 AM
#2
Well not sure if you REALLY want to call a method from a jsp... You should setup all the data needed in your page in your Controller. So you should extend your controller...
-
Jan 2nd, 2008, 09:02 AM
#3
From your short description, I'm not really sure this is what you are looking for, but it makes me think of Tiles and Tiles View Preparer. Tiles preparer are used to load data for specific template part. There is some integration with spring available.
-
Jan 2nd, 2008, 10:00 PM
#4
Hi,
Here is my clear explanation ,
ParentPage.jsp :
<!-- Some data to be displayed -->
<include childpage.jsp>
<!-- footer inlcude -->
Controller :
public ModelAndView redirect(Object command)throws Exception
{
return new ModelAndView("ParentPage.jsp");
}
Now the above method redirect to ParentPage.jsp.While including the childpage.jsp,i have to call another method to get some data from db without submitting the page.
-
Jan 3rd, 2008, 02:21 AM
#5
Your controller does nothing except redirecting to the view ? Why dont you load data for your "childpage.jsp" in that controller ? Is it because "childpage.jsp" is included in many places and you want to factorize the code ? In that case, you should definitely have a look at tiles and tiles-preparers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules