Home

General J2EE: Hiding the jsp name from addressbar

  1. Hiding the jsp name from addressbar (4 messages)

    Hello,
    My weblogic.xml file is configured this way. Please let me know if I have done some wrong any where.

      <virtual-directory-mapping>
        <local-path>D:/iw_webdata/www/www_corporate</local-path>
          <url-pattern>/</url-pattern>
          <url-pattern>*.jsp</url-pattern>
      </virtual-directory-mapping>

    I do not want to display the full url. e.g http://localhost:7001/test/index.jsp I wanted to display only http://localhost:7001/test/ and hide the jsp name.

    I tried all possible combinations, e.g removing <url-pattern>/</url-pattern> and adding only <url-pattern>*.jsp</url-pattern> but nothing is working.

    Any helps would be great.

    Uma
  2. Your best bet is to move your JSPs under WEB-INF, and use a controller (such as Struts, or a simple servlet) to forward to your JSPs.
  3. Hello,
    Thank you for your reply.

    iPlanet has this feature embeded in their configuration files. You can have a look at this website http://www.novanthealth.org which on load doesn't show you any index.jsp and when you click on any link it does not display the releavent jsp file name.

    I wanted to achieve this feature using Weblogic 8.1. Any ideas would be great.

    Uma
  4. When I visit, http://www.novanthealth.org I don't see the index.jsp, but that just means that index.jsp is marked as a welcome page. In a Servlet container you need at least Servlet 2.3 spec compliance before that can be set in your web.xml (I believe)

    However, every link I click after that I do see the JSP in the URL. As I said, if you really want to accomplish that in WebLogic, you'll need to use a controller servlet that can forward to the JSP internally. You also need to realize that you need something to tell it which JSP to choose, which is part of the URL or data posted to the server.
  5. Hi,
    Thanks for the reply. Please have a look at this link http://www.novanthealth.org/employer_services/
    http://www.novanthealth.org/job_information/

    the actual JSP page that is being using is default.jsp in both the links. We are not using any controller here. It works with iPlanet. There must be some configuration to be done with weblogic too to achieve this feature.

    I tried editing the web.xml file too but in use.

    <servlet>
    <servlet-name>myJSP</servlet-name>
    <jsp-file>index.jsp</jsp-file>
    </servlet>

    <servlet-mapping>
    <servlet-name>myJSP</servlet-name>
    <url-pattern>/DUM</url-pattern>
    </servlet-mapping>


    FYI: I am trying to deploy the same website in Weblogic which is currently running on iPlanet.

    Any help please?

    Uma