This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes how to write servlets without using NetBeans software Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to write servlets without using NetBeans software" Watch "how to write servlets without using NetBeans software" New topic
Author

how to write servlets without using NetBeans software

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

how to write servlets ,deployment descriptor,model etc maually?


http://www.lifesbizzare.blogspot.com || OCJP:81%
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Start typing?

What problems are you actually having?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
I always suggest that beginners start with the examples provided with the Tomcat distribution and modify them. Much easier to learn from your mistakes by starting with working code and make mistakes that break it than try from scratch.

Bill
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

i mean creating new folder such as web-inf, src,test etc if its done how to compile serverside and client side is by by using


javac classname.java?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
I cant make any sense out of that. Code for servlets is compiled just like any other Java code. Like I said, study the examples provided, including the web.xml files and the way the examples directory is laid out.

Bill
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If you're writing a webapp there's no compiling on the client side.

I'm still not sure what you're trying to do: you can write a web.xml by hand (easily), write a servlet, create a WAR file, and deploy it all by hand really easily. Are there specific steps you're having a problem with?
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

with netbeans ,yes i am specific by steps, but manually like creating folders i am not..Even if i create folder and all class files and all

what shhould be the 1st thing to compile servlets or model or view,controller and how to set the class path manually for the servlets ,model,controller


Also i have no idea about XML ..just know thaat they are reffered as deployment descriptor from where to learn XML and whatever folders i created how to put it on a server side (by the way i am trying on the same local machine)
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'd probably just search the web for a basic Java web app tutorial; it gives the directory hierarchy, where various files go, and what they should contain.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

Tomcat's documentation includes a pretty good description of the architecture of a WAR, and WARs are the basis of every J2EE web application. So it's a good thing to read up on.

Start here: http://tomcat.apache.org/tomcat-6.0-doc/appdev/index.html

The actual WAR layout information is here: http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html

There's also a section provided on how to organize project source for building with the ANT tool. Because of the multitude of different tasks it takes to build a WAR, I recommend you use a command-line build tool like Ant or Maven. Back before they were invented I used scripts and it wasn't much fun.

I make it a firm policy that ALL my projects can be built from the command without an IDE. While an IDE is a helpful thing to have, you shouldn't have to depend on it to make critical production builds. I learned this the hard way from IDEs that had become incompatible and from projects that people sent me that could only build if I had the exact same brand and version IDE as they did and had configured a lot of desktop-level items the exact same way they had. On top of that, one place I worked did production builds on a non-GUI machine. Where an IDE wouldn't work at all!


Customer surveys are for companies who didn't pay proper attention to begin with.
Larry Frissell
Ranch Hand

Joined: May 16, 2008
Posts: 82
    
    2
If you are trying to understand how the servlets work, I would highly recommend the Head First Servets and JSP. I have been working with that and it has explained how to set-up all the files manually, creating the XML files and a good explanation of how the container works.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There's a section in our Cattle Drive area on building servlets.

The tutorials there don't rely on IDEs.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
wood burning stoves
 
subject: how to write servlets without using NetBeans software
 
Similar Threads
Writing infor in Excel file through servlet
File I/O
How do you handle exceptions in init()
Generate pdf file using Servlets
Thread-safe servlets