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

  • Home
  • SEARCH
  • 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 6749383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:41:02+00:00 2026-05-26T12:41:02+00:00

when i write a GET or PUT method with params…then call it,if some params

  • 0

when i write a GET or PUT method with params…then call it,if some params don’t fill in,the params will be set as null,right?
such as

@POST
    @Path("/create")
    @Consumes(MediaType.TEXT_PLAIN)
    @Produces(MediaType.TEXT_PLAIN)
    @Override
    public String create( @QueryParam("meg")String megString, @QueryParam("name")String nameString) {
       TestUser testUser=new TestUser();
       testUser.setMeg(megString);
       testUser.setName(nameString);
       em.persist(testUser);
       em.flush();
       return testUser.getId().toString();

    }

then i post the url http://www.XXX.com/create?meg=”asdas”
the param name is not filled in ,will the value be null when it called?
thanks!

  • 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-26T12:41:03+00:00Added an answer on May 26, 2026 at 12:41 pm

    if some params don't fill in,the params will be set as null,right?
    It depends, on the default value of Input Parameters. In your case it will not set null, Because your input parameter (name) is String so the default value of String is empty or "" but not null.

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

Sidebar

Related Questions

I get to dust off my VBScript hat and write some classic ASP to
i write some utility class but how to get name ? Can that send
Ok, so C# has properties public int Prop {get;set;} I can put the getter
If I write [Pure] static string s10 {get;set;} static void Main(string[] args) { Contract.Ensures(s10.Length
I understand the get and put principle for collections: if a method takes in
How could I write code to get all the action names from a controller
Im trying to write something to get my images to show correctly. I have
How can I get an application to write debug text to the Event Log
How would you write a SQL query to get the size of blob in
I am trying to write a regex to get the numbers from strings like

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.