The Artima Developer Community
Sponsored Link

Java Answers Forum
JSP/Servlets newbie question

2 replies on 1 page. Most recent reply: Dec 3, 2005 4:54 PM by Joe Parks

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
gabri

Posts: 9
Nickname: gabri
Registered: Jan, 2004

JSP/Servlets newbie question Posted: Nov 11, 2005 9:56 PM
Reply to this message Reply
Advertisement
Hello,
I am trying to interface a service using JSP and servlets. I am getting a couple of difficulties, i would appreciate any help.
I am using Tomcat 4.1 and Java 1.4.2. I initially have a jsp that has a form, the action is my servlet and the method is post. Among the things i submit in form I have an
<input type=file name="somefile">

which i later try to retrieve in the servlet as:

Object o=request.getAttribute("somefile")

This doesnt seem to work (always null) and don't know what to use instead.

At some point i want to show status information back to the user at a certain refresh rate. How can this be done. If i output from the servlet html code with
<meta http-equiv="refresh" content="10">
i get an error at the first refresh attempt.

Thank you for any help,
Gabri


Rajeev Mutalik

Posts: 57
Nickname: rajmutalik
Registered: Sep, 2002

Re: JSP/Servlets newbie question Posted: Dec 1, 2005 2:24 AM
Reply to this message Reply
What exactly r u trying to send thru that form? I am not clear on that. R U trying to send the file itself or how it is? U can mail me at rajmutalik@yahoo.com

Regards,
Mutalik

Joe Parks

Posts: 107
Nickname: joeparks
Registered: Aug, 2003

Re: JSP/Servlets newbie question Posted: Dec 3, 2005 4:54 PM
Reply to this message Reply
There is an FAQ entry for this on jguru: http://www.jguru.com/faq/view.jsp?EID=1045507

The last suggestion there is, in my opinion, the best approach. That is, use the commons fileupload library: http://jakarta.apache.org/commons/fileupload

Flat View: This topic has 2 replies on 1 page
Topic: Barcode terminals ppc Previous Topic   Next Topic Topic: i need help in string tokenizer in a textfile pls!!!!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use