wood burning stoves 2.0*
The moose likes JSP and the fly likes Determine included JSP page name and load JSP into specified section using jQuery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Determine included JSP page name and load JSP into specified section using jQuery" Watch "Determine included JSP page name and load JSP into specified section using jQuery" New topic
Author

Determine included JSP page name and load JSP into specified section using jQuery

Alex Tom
Greenhorn

Joined: Apr 15, 2013
Posts: 4
Hi guys, I'm working on a web projects, but now i encounter this problem.

My main page main.jsp includes several different pages to make it up (please see the attachment).


when i click a item resides in the MENU, I use jQuery to load specified page into CONTENT:
partial code segment of menu.jsp:


Now the question is, i want to show "current location" in NAVIGATION, e.g, "current location: Main Page", "current location: Main >> User Mgmt >> Add User";
the concatenated string "Main Page" or "Main >> User Mgmt >> Add User" is dynamically determined by looking up a Map<page url, concatenated string>,
so I must get the page url loaded into CONTENT('#content'), which is part of the main page main.jsp.

How to get my job done?

THEN, the next question is as follows.
when i loaded a page, e.g., adduser.jsp, into CONTENT, and I submit it using jQuery, it doesn't work(and no any alert message occurs):
code segment from adduser.jsp(the form's id is 'auform'):


as the code illustrates, load the same page into original location CONTENT ('#content') when submit successfully.
but now, it redirect to content.jsp, which is included into main.jsp at startup.
and i notify the "url addr" of the submit button of adduser.jsp is exactly "main.jsp", why?

upon login, in my servlet code, i use the following code to "redirect" to my main page:

the reason I use this method is that if i use request.getRequestDispatcher("main.jsp").forward(request, response);,
the url in the browser's address bar is http://xxxxx/UserServlet?action=login .
in my login.jsp, the form's post action is "action="UserServlet?action=login""...

so are these phenomena related? Thanks in advance, and sorry for my poor English.



[Thumbnail for main.png]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Determine included JSP page name and load JSP into specified section using jQuery
 
Similar Threads
scroll bar down
Pressing the enter key receive extra invalid data
Struts 2
set values in a table from other
load specified file to another JSP page