leo blk

Greenhorn
+ Follow
since Feb 03, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by leo blk

Normally I will write a servlet that contains only methods and do include a jsp page to display. It's easy if you want to change the display you just need to change the jsp page without have to recompile and restart the server. This also make code much clean and organize.
20 years ago
here is the correct code

public void doPost(HttpServletRequest request, HttpServletResponse respone) throws ServletException,IOException
{
doGet(request, response);
}
20 years ago
try added the doPost

public void doPost(HttpServletRequest request, HttpServletResponse respone) throws ServletException,IOException
{
doGet(req, res);
}
20 years ago
I have not yet tried the war, but thanks for the pointer Chris.
20 years ago
Forgot one thing, the previous reply is for application class to get path. If you are coding the servlet you can always call
getServletContext().getRealPath("/");
20 years ago
You may also wanna try out Class.getResource(""), this will not need any hardcode, but it's a bit tricky.
It will return all the locations that the class you are calling the getResource, all you need to know is where you put your config file and what is the return of the getResource from the class you passed and do some touch up.
Just code a simple jsp and do some testing to find out what exactly you need to do.
20 years ago