• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to write servlets without using NetBeans software

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to write servlets ,deployment descriptor,model etc maually?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start typing?

What problems are you actually having?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Larry Frissell
Ranch Hand
Posts: 82
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a section in our Cattle Drive area on building servlets.

The tutorials there don't rely on IDEs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic