Questions tagged [contextpath]

Context path refers to the portion of the web request URI that indicates the context of the request. The context path always comes first in a request URI.

Context path refers to the portion of the web request URI that indicates the context of the request. The context path always comes first in a request URI.

For example - in the http://www.example.com/myContextPath/hello.jsp, the context path is myContextPath.

216 questions
3
votes
2 answers

Tomcat/TomEE adding "/localhost" into servletContext.getResource("myStaticFile")

My WAR is deploying fine in TomEE under the correct context root "/myApp" so that I can go to http://localhost:8080/myApp I have some static files under: /myApp/WEB-INF/files From looking at the exploded WAR the files are definitely there. My…
Justin
  • 859
  • 4
  • 15
  • 30
3
votes
1 answer

Jetty :: ServletContextHandler#setContextPath(..) and how to associate Servlets with specific file extensions

I have the following code in Jetty: ServletContextHandler contextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS); contextHandler.setContextPath("/a"); ServletHolder holder = new…
Marcus Junius Brutus
  • 26,087
  • 41
  • 189
  • 331
3
votes
2 answers

Tomcat secure folder in webapps

I have a web application and Tomcat, like server for it. I put my web app in the folder: $(TOMCAT_HOME)/webapps/myapp and my images to the $(TOMCAT_HOME)/webapps/images And I wrote next in the tomcat's server.xml
Andry
  • 655
  • 2
  • 11
  • 22
3
votes
1 answer

How to define src attribute from web application context in JSP

I wanted to use absolute path in src attribute, while including Javascript and CSS files in JSP. Using relative URLs would not serve my purpose, similar to the one below : If…
Rohit Bansal
  • 1,199
  • 1
  • 10
  • 18
3
votes
2 answers

Serving files from within a Tomcat context

I have a web application deployed to Tomcat 6 as a WAR file. From within the application I would like to serve files in a directory from within that context. For example, I deploy myapp.war to /mydir/webapps and I access my application…
Brian
  • 155
  • 1
  • 2
  • 9
2
votes
1 answer

I am using $this in a class, but it keeps giving me Fatal error: Using $this when not in object context

I created a a cart class which contains songs to be bought. The cartSong class works fine, but when I use the cart class, an error about $this always comes up. I want the variable $songList (array) to add a song object to the cart every time…
Jack Sparser
  • 75
  • 2
  • 10
2
votes
5 answers

Tomcat does not recognize my context

I have a web application and use tomcat-5.5.27, eclipse 3.4 on open SUSE. I use it from eclipse (deploy, run, debug, etc...) I have to set some JNDI resources (datasources) that Tomcat will expose them. These resources are defined now in…
Andrei
  • 43
  • 1
  • 5
2
votes
1 answer

specify variable context path in spring security (3.0.x)

We are developing "box" web-product, so I cannot foreseen the environment where application is deployed. This application uses spring-security. But it is appeared that if Tomcat placed application not at the root then following configuration…
Dewfy
  • 23,277
  • 13
  • 73
  • 121
2
votes
1 answer

Defining context path for spring boot application in external tomcat

I have a spring boot application abc.myapp.war, that is deployed on external tomcat server. By default the tomcat uses the war file name as the context path of the application deployed so it becomes http://localhost:8080/abc.myapp, but I want to…
2
votes
2 answers

How to access an external server folder from a spring boot docker container?

I'm using docker-compose to run spring boot application inside a docker container. A spring boot uses embedded tomcat to run. There is an external folder on a server (/opt/cp/uploads) with images which I would like to access from a spring boot…
2
votes
3 answers

Start sprinboot in minkube with custom context url as environnement variable

I have a springboot app which I want to deploy on Kubernetes (I'm using minikube) with a custom context path taken from the environment variables. I've compiled an app.war file. exported an environment variable in Linux as follow: export…
2
votes
0 answers

Stripping ContextPath in WebFlux router?

I have a WebFlux application that is behind nginx-ingress. In order to have redirect working (for purposes of Spring Security OAuth) I enabled ForwardedHeaderTransformer. Now redirects generated by Spring Security OAuth are working fine, but the…
pixel
  • 24,905
  • 36
  • 149
  • 251
2
votes
1 answer

How to make Railo/OpenBD process files under Tomcat nodes?

I have a Tomcat host defined like this, with the WEB-INF of Railo OR OpenBD in the webapps/ROOT directory. If I…
Dave Shuck
  • 583
  • 1
  • 6
  • 19
2
votes
1 answer

Double slash in context path in Websphere Application Server

I would like to know if it is possible to put a context path like this when deploying a WAR to Websphere Application Server: /api/v3.1, and another one with the same context path but for another version of the API to be launched in the same WAS. In…
Paolo Carrasco
  • 59
  • 1
  • 1
  • 10
2
votes
1 answer

Context path routing issue in Cloud Foundry

I am currently deploying a dynamic Java application (servlet based) to Cloud Foundry Java buildpack (Tomcat). We are using context-path based routing. For Spring application we are setting a context path in application-properties files or…
PRAMOD N
  • 21
  • 1
  • 2