Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1102073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:07:39+00:00 2026-05-17T01:07:39+00:00

I am working with a sample RESTEasy 2.0 resource on Spring MVC 3.0 and

  • 0

I am working with a sample RESTEasy 2.0 resource on Spring MVC 3.0 and deplying to Tomcat 6. I can get to my resource through http: //localhost:8080/examples-resteasy-2.1-SNAPSHOT/contacts but I would like to access through http: //localhost:8080/contacts or even http: //localhost:8080/myservice/contacts

Is there something I need to change in the way my application is mapped to the path?

Web.xml

<web-app>

    <servlet>
        <servlet-name>springmvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:springmvc-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>/contacts/*</url-pattern>
    </servlet-mapping>

</web-app>

springmvc-servlet.xml

<beans xmlns="http: //www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
        http: //www.springframework.org/schema/context http: //www.springframework.org/schema/context/spring-context-3.0.xsd
        http: //www.springframework.org/schema/beans http: //www.springframework.org/schema/beans/spring-beans.xsd
    ">
    <context:component-scan base-package="org.jboss.resteasy.examples.springmvc" />
    <context:annotation-config />
    <import resource="classpath:springmvc-resteasy.xml" />  <!-- this is included in the resteasy-spring library-->

    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
        <property name="prefix" value="/WEB-INF/" />
        <property name="suffix" value=".jsp" />
    </bean>

</beans>

my RESTEasy resource class

@Controller
@Path("/contacts")
public class ContactsResource {
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:07:40+00:00Added an answer on May 17, 2026 at 1:07 am

    You can set these in your Tomcat server.xml.

    Add a <Context> element within the <Host> like below which sets your examples-resteasy-2.1-SNAPSHOT as the default web app.

    <Context docBase="examples-resteasy-2.1-SNAPSHOT" path="" reloadable="true" />
    

    This should allow you to access it as http: //localhost:8080/contacts

    Set the path to “myservice” like below

    <Context docBase="examples-resteasy-2.1-SNAPSHOT" path="/myservice" reloadable="true" />
    

    should allow you to access it as http: //localhost:8080/myservice/contacts

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get this sample for AJAX to WCF working, with the following
I'm looking for good/working/simple to use PHP code for parsing raw email into parts.
I'm working on a simple ASP.Net page (handler, actually) where I check the value
I'm working on a simple multiplayer game in which 2-4 players are placed at
I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display
i am working on a simple web app which has a user model and
I'm working on a simple 2D game engine in Java, and having no trouble
I'm working on a simple javascript login for a site, and have come up
I am working on a simple notification service that will be used to deliver
I am working on a simple CAD program which uses OpenGL to handle on-screen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.