File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes New to J2EE: Is browser only option as the front end tool in J2EE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "New to J2EE: Is browser only option as the front end tool in J2EE" Watch "New to J2EE: Is browser only option as the front end tool in J2EE" New topic
Author

New to J2EE: Is browser only option as the front end tool in J2EE

Ajai Augustine
Greenhorn

Joined: Sep 13, 2004
Posts: 7
I am new to J2EE and I have some questions about J2EE Actually I couldnt find an answer anywhere.
1.is jsp/servlet can only be used when we are using internet and browsers to display the front end?
2.Is this jsp/servlet only for developing web applications like e-commerce web sites? Can it be used to develop other applications like software for companies, that do their regular job like inventory management or pay roll management?

Any help?
Thanks
Ajai
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
No to both.

You can create Servlets and JSPs to work on any protocol though in practice HTTP is used almost exclusively.

The tech is used a lot in corporate websites and intranet applications, often invisible to the naked eye,


42
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624


1.is jsp/servlet can only be used when we are using internet and browsers to display the front end?

If using a browser as a front end, then jsp/servlet would likely be your choice for a front end display. But you could also right an applet (using Swing for a GUI) that runs in a browser. That applet can then communicate back to the server. If you did not use a browser, you could use a client installed application or a Java Web Start application, either as a standalone application or to connect back to a server if your application required such.


2.Is this jsp/servlet only for developing web applications like e-commerce web sites? Can it be used to develop other applications like software for companies, that do their regular job like inventory management or pay roll management?

jsp/servlet, and J2EE, can be used to create anything. E-commerce is a common use, but inventory, payroll management, time tracking, basic websites, advanced websites, remote mainframe connectivity, and a lot of other things can (and have) been done.
Ajai Augustine
Greenhorn

Joined: Sep 13, 2004
Posts: 7
Thanks a lot for your quick reply.

If I use Swing to create a front end(no browsers invloved, Just a JFrame), and send the data to server using HTTP(I dont know how), whether a servlet or jsp program at the server be able to handle that data, in the same way, it handles data from html form, send using internet. I mean whether I will be able to use implicit objects and more like request.getParameter().

[ March 06, 2005: Message edited by: Ajai Augustine ]
[ March 06, 2005: Message edited by: Ajai Augustine ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

If you were going to write a Swing front end I would wonder why you want to impose the limitations of the HTTP protocol on your program.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ajai Augustine
Greenhorn

Joined: Sep 13, 2004
Posts: 7
If you were going to write a Swing front end I would wonder why you want to impose the limitations of the HTTP protocol on your program.


I just want to know, whether I will be able to use, jsp/servlet in an environment like that. Or is that a good idea?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31057
    
232

Ajai,
If you choose to use Swing, you would make remote EJB calls to the server. The Swing front end would replace the JSP/servlet front end. You wouldn't use both.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
Originally posted by Bear Bibeault:
If you were going to write a Swing front end I would wonder why you want to impose the limitations of the HTTP protocol on your program.


Maybe he has a firewall to deal with. HTTP makes that quite a bit easier. You can use JAX-RPC to talk to objects on your server using SOAP. A servlet would "front" your implementation objects, translating a SOAP request into a method call.


James Carman, President<br />Carman Consulting, Inc.
Ajai Augustine
Greenhorn

Joined: Sep 13, 2004
Posts: 7
Hi guys,
May be I am not explaining clearly.
I am just new to servlet/jsp and all those related things. I have learned those and used in small web sites.
then now I want to know whether I can use, these jsp/servlet in an environment like this.
A small company, with an intranet. Have a server and different clients, which employees can use to do day to day works.
I know I can develop applications just by using java, and clients using swing and connect client and server using RMI.
I just want to know, in this environment is this jsp/servlet is of any use. or just following the way I explained above is the only or best option.

May be I am not understanding things right
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
A servlet that takes XML in and produces XML out can be a server to any kind of client. Talking "XML over HTTP" is a common way to build "web services". I think of it as a useful "lowest common denominator" that can be called by clients in nearly any language and OS or platform. So, yes, you could build a Swing client using HTTP to call servlets.

SOAP is a standard for formatting the XML. You can get some cool SOAP tools like Apache Axis or BEA's Glue that make remote SOAP calls nearly as simple as any object method call. They can even make the XML invisible - you never have to touch it. Glue once ranked very well on interoperability with different clients, eg Microsoft dot net and other languages and tools. I don't if that's important to you or how they're holding up lately.

If it's ok to say your server will support Java clients only you could look at RMI (considered seriously broken by some) or even EJB remote calls. I used a vendor framework with proprietary remote protocols, not something I'd recommend writing unless you have LOTS of time on your hands.

Any of that sound useful to you?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Maybe you, should learn grammar, for english is good idea?

Seriously, your grammar is so poor that it's almost impossible to comprehend what your actual question is.
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
Originally posted by Jeroen Wenting:
Maybe you, should learn grammar, for english is good idea?

Seriously, your grammar is so poor that it's almost impossible to comprehend what your actual question is.


Wow! That was harsh! True, but harsh.
Ajai Augustine
Greenhorn

Joined: Sep 13, 2004
Posts: 7
Hi
I will definitely work on my grammar.

But I think I got the answer for my question.

If you choose to use Swing, you would make remote EJB calls to the server. The Swing front end would replace the JSP/servlet front end. You wouldn't use both.



I thought jsp/servlet is to process the data from any gui. Because when I used the JSP, I used HTML form to create the gui and JSP to process the data. But the truth is it is to create gui, right?
And when we use jsp/servlet as the front end then we have to use browser to display the gui.

Thanks again
Ajai
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31057
    
232

Ajai,
Right! It is best to keep logic/data processing out of the JSP. It's ok to put it in the servlet though. The JSP should be pure presentation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: New to J2EE: Is browser only option as the front end tool in J2EE