nforchu cheka

Greenhorn
+ Follow
since Jul 16, 2010
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 nforchu cheka

Hi guys. please can some one tell me how i can prevent the .jsp extension for my jsp pages from showing up in the address bar.

I have been trying to do that. that only thing i can think of right now is providing a servlet mapping for all the pages in my application. but sure that would be hell. if i have to do that for all pages in the application.
you have a wonderful time.
13 years ago
JSP
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
response.setContentType(“application/jar”);
ServletContext ctx = getServletContext();
InputStream is = ctx.getResourceAsStream(“bookCode.jar”);
int read = 0;
byte[] bytes = new byte[1024];
OutputStream os = response.getOutputStream();
while ((read = is.read(bytes)) != -1) {
os.write(bytes, 0, read);
}

RequestDispatcher view = request.getRequestDispatcher(“result.jsp”);
view.forward(request, response);
os.close();
}


i can't understand why i have an error with this. because i know calling os.flush() before dispatching the request will give me an IllegalStateException. but i don' know if write commits the response too.
13 years ago
JSP
hi friends, i am princewill cheka and i am planing to take on SCJP 1.6 exam any time soon
can any one kindly give me information on how to get some good study material?
hope to read from you soon
you have a nice time and take care. see you