contextpath

How to auto direct to “my web application” from “root (/)” context in JBoss?

心不动则不痛 提交于 2019-12-02 23:09:43
I am using JBoss 6.0 . I have deployed my web application: myApp.ear under the web-context: " /test ". So in browser-url if I type " http://localhost:8080/test/ ", I do get my login page (myLogin.jsp). Since my WAR exists inside a EAR file, I have specified the context root in the application.xml file using a context-root element inside of the web module - i.e. <module> <web> <web-uri>myWeb.war</web-uri> <context-root>/test</context-root> </web> </module> My question is how to auto direct user to my web-app from "root context"? I mean if user types " http://localhost:8080/ ", I would expect my

Spring REST mock context path

痞子三分冷 提交于 2019-12-02 01:23:12
问题 I try to set the context path for spring rest mocks using the following code snippet: private MockMvc mockMvc; @Before public void setUp() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context) .apply(documentationConfiguration(this.restDocumentation)) .alwaysDo(document("{method-name}/{step}/", preprocessRequest(prettyPrint()), preprocessResponse(prettyPrint()))) .build(); } @Test public void index() throws Exception { this.mockMvc.perform(get("/").contextPath("/api").accept

How to set Spring root context path

一曲冷凌霜 提交于 2019-12-02 01:10:53
I am a Spring newbie and am putting together a Spring web-app (not Spring-boot - how much difference does this make?). Deployment is on a Tomcat 7 server. The app is up and running. My problem is that is only accessible via the standard URL: http://mycompany.com:8081/cwing-0.0.3-SNAPSHOT/index.html The following do not work: http://mycompany.com:8081/cwing-0.0.3-SNAPSHOT http://mycompany.com:8081/cwing-0.0.3-SNAPSHOT/ even though my web.xml lists index.html as the welcome page. An additional symptom of the problem is that all sorts of links within the application need to be specified as

Spring REST mock context path

﹥>﹥吖頭↗ 提交于 2019-12-01 22:18:43
I try to set the context path for spring rest mocks using the following code snippet: private MockMvc mockMvc; @Before public void setUp() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context) .apply(documentationConfiguration(this.restDocumentation)) .alwaysDo(document("{method-name}/{step}/", preprocessRequest(prettyPrint()), preprocessResponse(prettyPrint()))) .build(); } @Test public void index() throws Exception { this.mockMvc.perform(get("/").contextPath("/api").accept(MediaTypes.HAL_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("_links.business-cases", is

EL context path evaluation difference between outputLink and graphicImage

混江龙づ霸主 提交于 2019-12-01 03:55:20
问题 I'm using the following to get a help document in our app. My problem is that while the <h:graphicImage> evaluates the context path correctly, the h:outputLink evalutates it to nothing. I have tried using both $ and # in the h:outputLink because I understand they have different evaluation times. What is the difference in how the two EL expressions evaluate? <h:outputLink value="${pageContext.servletContext.contextPath}/services/help.pdf"> <h:graphicImage url="${pageContext.servletContext

Retrieving the servlet context path from a Spring web application

≯℡__Kan透↙ 提交于 2019-11-30 12:58:32
问题 I would like to be able to dynamically retrieve the " servlet context path " (e.g. http://localhost/myapp or http://www.mysite.com ) for my spring web application from a Service spring bean . The reason for this is that I want to use this value in email that are going to be sent to users of the website. While it would be pretty easy to do this from a Spring MVC controller, it is not so obvious to do this from a Service bean. Can anyone please advise? EDIT: Additional requirement: I was

Is there a built-in Spring environment variable for the web context root?

可紊 提交于 2019-11-30 05:03:06
I'm using Spring Web Services to expose a service as a web service. In my spring configuration xml file, I have a bean which is an instance of DefaultWsdl11Definition. One of the properties that needs to be set is the locationUri . This needs to be a fully qualified Uri, but I don't want to have to change this value when the application gets promoted from dev to uat and to production. Spring knows what the web application context root is, so is there a variable that I can specify in my configuration file to access it? Something like: <bean id="myWebServices" class="org.springframework.ws.wsdl

Retrieving the servlet context path from a Spring web application

前提是你 提交于 2019-11-30 04:21:21
I would like to be able to dynamically retrieve the " servlet context path " (e.g. http://localhost/myapp or http://www.mysite.com ) for my spring web application from a Service spring bean . The reason for this is that I want to use this value in email that are going to be sent to users of the website. While it would be pretty easy to do this from a Spring MVC controller, it is not so obvious to do this from a Service bean. Can anyone please advise? EDIT: Additional requirement: I was wondering if there wasn't a way of retrieving the context path upon startup of the application and having it

Why is my EL-statement only working in a script-tag where I do not import a js.file through a src-reference?

回眸只為那壹抹淺笑 提交于 2019-11-29 17:01:07
I have a javascript file, where I have collected login- and other user profile ajax calls that needs to be available on all of the pages in my web application. For all of my ajax calls, I need the context path of the webapp to get the correct URL. A baseUrl-variable can be defined by var baseUrl = "${pageContext.request.contextPath}"; . I am experiencing a puzzling error though. If i try to initialize the baseUrl variable inside my login.js -file, it does not work. It is simply set to the string value "${pageContext.request.contextPath}" This .js-file contains all the scripts where I actually

symlinking tomcat 8 directory resources

空扰寡人 提交于 2019-11-29 11:58:02
问题 I would like to symlink JSP directories under Tomcat 8. It worked as well in Tomcat 7 on this way: <Context allowLinking="true"> but seems the Tomcat 8 dropped this feature, and it started to use the Resources ( http://tomcat.apache.org/migration-8.html#Web_application_resources ). My example usage: ROOT/jspdirectory -->linksto--> /var/tmp/realplaceofjspfiles/ A bad configuration: ROOT/META-INF/context.xml: <Context> <Resources allowLinking="true"> <PreResources className="org.apache.catalina