page « URL « JSP-Servlet Q&A

1. JSP Page Forwarding: Relative URL Issues?

I have a bit of an issue for my JSP site. I have it divided into three sections: a main folder within which a "resources" and an "actions" folder are. I house ...

2. How do I retain a requested url with parameters after redirecting to a login page?

I have been asked to set up some authentication for some content on our website using JSP. What I would like to do seems simple to me but I can't ...

3. Creating render urls to link between pages in a community in Liferay

I've set up a Liferay community, along with a number of pages each defining there own set of portlets, themes and layouts. I want to be able to create links between ...

4. Getting URL value from HashMap in a JSP page (Using Struts2)

I am trying to get my page to link to a certain URL that is stored in a HashMap (the key is some name, and the value is the URL I ...

5. How do I include another login page and direct the user to one of the two login pages based on his url?

Here is my code to handle one url redirect but how do I implement two url redirects based on the user's url?

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    import="com.example.common.config.RuntimeConfig" %>

6. 404 error page for all url contexts

I have a custom 404 error page in my java web app. (declared using web.xml) It is working in all the cases. But if the url pattern comes like for example : the ...

7. JEE web.xml: How to exclude a single page from a

I want on all pages BUT ONE (header.jsp) to include-coda like in this code:

I just don't get how I can limit the Pattern to exclude header.jsp

8. Go back in url-pattern (invoking servlet from a jsp page)

I have made small web-app in jsp with a start page with login and some restricted pages with logout, -everything controlled with filters and servlets. I started making it because I ...

9. Why JSP pages often use ! in the url?

Like:!input.jspa?container=2065&containerType=14 Is there any trick in JSP that cause ! so often used in the url?

10. Get URL of page requested that caused a 404

How would I get the URL of the page that was requested that caused the 404 error? For example, I type I go to I already have a custom 404 ...

11. In Struts 1, how to specify input page URL and not path to JSP

I have a very annoying problem with Struts. The input page is located under an URL similar to this: /news/send/. URLs of this type are required by the CMS we're using. In ...

12. JSP Site web.xml issue Page not found for url-pattern /MyController in sevlet-mapping

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
    <description>This is ...

13. Get the URL from mJSP page

I would grab the URL of the current JSP web page with its settings example: index.jsp? param = 12 Have you any idea? Thank you

14. JSP check URL is for the current page

What is the best way for checking if I'm on especific URL? If I have a many links, and I want to disable some the link for the current page. How ...

15. How to load a page from a page without modifying the url in JSP?

I have a web application which is secured by login. If a user's session has expired how do I display an error page when the user attempts to load the secured ...

16. JSP/Servlet : How to Read an image via URL and render it on a JSP page (image URL is not public)

what's the best approach to read an image via URL and render it on a JSP page? so far, I've coded two JSP pages. EDIT START:

 *Experimental: Obviously the ImageServ will be a ...

17. jsp page not visible in url

Hi, In my web.xml, i give a home page by clicking on 'Pages' tab. When I run my project by right clicking my project name, I dont get the jsp file name in the url, why? Due to this, when i try to direct my jsp page to another jsp page or some servlet, it gives me 'Requested Resource not available' ...

18. [S2] Passing URL as parameter between JSP pages

I am developing an app for which there is a common pagination bar (call it "paginationInclude.jsp") that is included at the bottom of several different pages. The pagination include needs to get a "base url" from the including page and then append a "pagenum" param to that URL to generate the final URL for the numbers in the pagination bar. How ...

19. INculde url into page

20. Get URL of parent page in an included JSP page

Because the server-side include is being handled completely outside of the JSP/Servlet arena, there isn't likely to be a way to obtain this information unless your web server somehow makes it available as a system parameter or something. What web server is handling the ssi? If the web server does not make this info available, then a somewhat hacky way to ...

21. How to get the url of the page causing the 404 in custom error.jsp?

Hi, In our application when a user types a bad url, a custom error message is displayed. for this we are using error.jsp. Now i want to get the user typed url which is causing the 404 error. When i tried to used request.getHeader("Referer") it gives the error.jsp url only. Any idea of how to get the bad url? thanks.

22. can I remove the displayed SessionID in URL's of pages using Struts

Hi! I am a new member here as well as new in JSP/Struts. I am creating examples of Struts applications and I notice that on the address bar of the browser, the session ID also appears along with the JSP page I am currently displaying after a Submit. Is there a way to remove the session Id display and display only ...

24. URL connection and opened web page?

26. getting the url of original page

28. getting the URL for the calling jsp page?

Hi all if i have a jsp page(caller.jsp) that has one or two textfield,one for id and the other for password. if i want to make that jsp call a response.jsp,that response.jsp just catches those parameters (id and pass). if somewhere in my response.jsp i want to get the url for the caller jsp(in our case it is caller.jsp) how can ...

29. removing jsp page address in url

Are you using EJB ? If yes then try using below ways ::: 1) Using session-based storage. session.setAttribute("name", value); String exforsys = (String) session.getAttribute("name"); ( 2) Using a server-side post. try { String stuff = null; String pagecontent = ""; String parameters = "&message=hello+world&"; url = new; conn = (; conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Length", "" + Integer.toString(parameters.getBytes().length)); conn.setRequestProperty("Content-Language", "en-US"); conn.setRequestProperty("Content-Type", ...

30. include page(file) using URL

33. How to get the Full URL of the Referring or Previous Page

Hi, having trawled the net, I cant find an absolute answer ... ... so am hoping you can help. I am building a corporate web site that has a variable strap line / message on the home page. At the moment the message is randomly generated and may not therefore relate to what a visitor is interested in. What I want ...

35. getting parent URL from JSP page

36. How to get the URL of the page which redirected to our site ?

Hi All, I have a small question here. My problem is to fetch the URL of the page which redirected to our site. Suppose, say there is a site, which has a link to Andif any one clicks on that link in the abc's site, then it will re-direct to xyz. But without directly getting any inputs from abc, ...

40. Exception when URL connects to JSP page

Did you have the web application behind the URL working when you ran your code? I believe that [URL.openStream|] will throw the [IOException|] if it cannot connect to something at the specified URL. In other words, can you see your page in a regular web browser at the same time this class doesn't work? Also, the IOException often prints out a ...

41. how to pass multiple values via url from one jsp page to another

Since, presumably, you're generating these URLs in the first JSP, then run the values (e.g. empoloyeeId) through the method before inserting them in the URL. That will take care of all your dubious characters. Better yet, use the JSTL tag library and the