0

The idea is to automatically have:

http://localhost:7001/myApp/

instead of:

http://localhost:7001/myApp

Thanks for anyone helping me.

EDIT : I think expressed myself wrong. Actually, I just want to 'force' browser to be redirected to (localhost:7001/myApp/) when it tries to get (localhost:7001/myApp). In other words, adding a slash so that css, js, links load properly.

Mayas
  • 1,434
  • 5
  • 16
  • 25

2 Answers2

1

I finally resolved this issue by manually adding the context path, this way:

<%@ page pageEncoding="windows-1252"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> 
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%
        String context = request.getContextPath();
    %>

... further in my jsp and wherever I need:

<a href="<%=context%>/manageUnavailabilities?requestType=create">

The result is that I have links like these:

http://localhost:7001/myApp/manageUnavailabilities?requestType=create

Instead of:

http://localhost:7001/myAppmanageUnavailabilities?requestType=create

Thanks for your help.

Mayas
  • 1,434
  • 5
  • 16
  • 25
0

You will want to set the context-root value for your application. You'll want to edit your application.xml file in your .ear or your weblogic.xml file in your .war and add:

<weblogic-web-app>
    <context-root>myApp/somethingElse</context-root>
</weblogic-web-app>

Reference the Oracle docs here

Many similar questions have been asked, see Application Context

BTW - your question needs to be edited, you pasted the same URL twice but I got the gist of the question.

Community
  • 1
  • 1
Display Name is missing
  • 6,197
  • 3
  • 34
  • 46
  • ​Thanks for replying, I think expressed myself wrong, actually, I just want to 'force' browser to be redirected to (localhost:7001/myApp/) when it tries to get (localhost:7001/myApp). In other words, adding a slash so that css, js, links load properly. – Mayas Aug 28 '14 at 07:43
  • I have something similar in the application.xml as follows: ` vip-webapp-4.0.0-SNAPSHOT.war vipWebapp/ ` The second link in your answear shows how to do the opposite. I hope you'll understand better :) – Mayas Aug 28 '14 at 07:51