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 8617629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:54:25+00:00 2026-06-12T05:54:25+00:00

I like to expose one JAVA method as a Web service that will accept

  • 0

I like to expose one JAVA method as a Web service that will accept POST ,strip the parameters out of it and reply accordingly. I read I have to use doPost(req,resp) , but How can I get to the servlet code? what should be in web.xml? there will not be a welcome-file ? After mapping the servlet, can I read it without the need for a index.html as start point?

  • 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-06-12T05:54:27+00:00Added an answer on June 12, 2026 at 5:54 am

    create the doPost(req,resp) method in your servlet and map it to a url in web.xml

    <servlet>
            <servlet-name>HelloPost</servlet-name>
            <servlet-class>packageName.HelloPost</servlet-class>
    </servlet>
    
    <servlet-mapping>
            <servlet-name>HelloPost</servlet-name>
            <url-pattern>/post-url</url-pattern>
    </servlet-mapping>
    

    then you can post your request to /post-url .You don’t need to use index.html.Any url can be put in welcome file to load for the url /
    To set /post-url as landing page , use

    <welcome-file-list>
            <welcome-file>/post-url</welcome-file>
    </welcome-file-list> 
    

    you can get started here https://developers.google.com/appengine/docs/java/gettingstarted/creating

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

Sidebar

Related Questions

I would like to expose a function that can take an optional anonymous method
I have a web sercice method that recieves an object. One of the attributes
I am creating one simple conference application (Java based) and using RESTFull Web Service
How would one expose static variables like this class MyClass: X = 1 Y
I have a Silverlight ModelViewViewModel project that I would like to expose a property
We've got a bunch of data that we'd like to expose to the world
I am attempting to expose documentation (like Javadocs) for a SOAP Service. Best case,
I want expose WebClient.DownloadDataInternal method like below: [ComVisible(true)] public class MyWebClient : WebClient {
In Java, I'd like to be able to define marker interfaces, that forced implementations
We have a Java web application and we'd like to set up some basic

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.