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

Can someone explain the statement below to me with a working sample/example. thanks in
I'm working on a sample i found on this site: http://kevinmusselman.com/blog/2009/02/access-webcam-with-flash/ it captures the
I am working with the sample Home application project on http://developer.android.com/resources/samples/Home/index.html I've added another
I could not find a working sample which shows Spring security ldap/active directory auth.
I am looking for suggestions and working sample for implementing Faceted Search using Spring
Anyone can give me a working sample of JSF2.0 + richfaces4.0? I just upgrade
I'm looking for a working sample of an ASP.NET MVC web application that uses
I'm working on sample webapp that I'm supposed to show to my CTO. It's
I am working with sample REST service with Apache CXF, But somehow I am
I am working on a sample map kit app for iOS. I have everything

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.