Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: General help with servlets

  1. #1
    Member
    Join Date
    Aug 2014
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default General help with servlets

    Hi all,
    I am trying to deploy an android application that connects to a java server. I am doing an apointments system, so the client asks for an apointments with a specific office/doctor.
    What i did, was to create a java server, using object for the offices, and via sockets it communicates with the android client.

    The problem is that when i tried to use my (very demo still) app on my phone and sent it to some friends for testing, i coulnt find a way to have my server on the internet.
    So I changed to (or trying to) servlet. But i have no idea how to do a client server application with servlets. All tutorials i have seen are more on website clients, but thats not what i need.

    Can someone help me on this one pls?

    thanks alot, ilias


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,777
    Thanks
    54
    Thanked 2,340 Times in 2,311 Posts

    Default Re: General help with servlets

    i coulnt find a way to have my server on the internet.
    Using servlets won't help other devices to connect to your server where the servlets are hosted.
    Can you use your PC for a server by using its IP address? The problems will be getting through the router and past the firewall.

    For local testing using an IP address that starts with 192.168 you might be able to do it on WiFi.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    Aug 2014
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: General help with servlets

    I would like to sent it to friends for testing, so local ip is out of the question,
    I think that my router is too cheap, and probable it blocks ddns. I tried to use them i was getting a connection error.

    Quote Originally Posted by Norm View Post
    Using servlets won't help other devices to connect to your server where the servlets are hosted.
    What do you mean by that?
    that i cant use servlet to comunicate with clients? Or that i cant use servlet to communicate with my server. I guess the later can not be done, and i will have to rewrite everything for the servlet.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,777
    Thanks
    54
    Thanked 2,340 Times in 2,311 Posts

    Default Re: General help with servlets

    What do you mean by that?
    I was referring to java servlets which run on a server. The name of the servlet to use is passed in the URL to the HTTP server which passes the URL and any data to the servlet.

    Some routers can be configured to pass incoming requests to one of the computers on the LAN.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    Aug 2014
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: General help with servlets

    Quote Originally Posted by Norm View Post
    Some routers can be configured to pass incoming requests to one of the computers on the LAN.
    I finally managed that!!!
    At least i can do some proper testing now. but still if i want to put my app out there, i will need some kind of server. I will have to look into that.

Similar Threads

  1. servlets
    By pravin in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 2nd, 2014, 10:05 AM
  2. JSP and servlets
    By keepStriving in forum Java Theory & Questions
    Replies: 2
    Last Post: December 28th, 2013, 01:05 AM
  3. Help with JSP and Servlets
    By skyinfire305 in forum JavaServer Pages: JSP & JSTL
    Replies: 10
    Last Post: July 29th, 2010, 09:06 AM
  4. Servlets and HttpSession
    By DC200 in forum Java Networking
    Replies: 3
    Last Post: November 17th, 2009, 03:32 AM
  5. [SOLVED] How to link two servlets?
    By bhmadhukar in forum Java Servlet
    Replies: 4
    Last Post: May 19th, 2009, 09:24 AM