cho con

Greenhorn
+ Follow
since Apr 02, 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 cho con

Actually I don't use getParameter() method, I am new to JSP and I found some code example for upload file, it works fine, but when I integrate to my part, it didn't recognize the "multipart/form-data". The attached files are the code that I got with a simple text input, 2 controls of file input and it can upload, I didn't change any thing except that put more controls (aligned in a table that devided into 2 parts) and use the empty action form. Finally, I don't understand what the problem from?
This is the upload html



This is the upload jsp

13 years ago
Here is the code that handles request:




And the following is a piece of code in file Upload.jsp. From this statement, it shows that the previous form is not multipart/form-data


13 years ago
Actually, I'm new to web development, so I just study from the other to have a better layout . I try to test many time, but it still cannot recognize, took me nearly one day for this problem (
Hi all,

I have the trouble that JSP cannot recognize the "multipart/form-data" then I cannot upload the file on server, here is my code, could you please see for me



The action in the form here is empty and the the submission of this form will be manage by


with the value = "finish" then servlet will navigate to another page (this code I put in doPost method, I often do like this and everything is ok, so I think it's not the problem from the empty action in form). But when I navigate to a page which has a piece of code:



and the result was that it is not a "multipart/form-data". I really frustrate with this problem since I cannot do any thing with my project, I have to upload the file on server, but it cannot recognize the form as a multipart/form-data and I get stuck at this step, could you please help me? I greatly appreciate your help! Thanks a lot



13 years ago
Hi all,

I would like to ask that when I put the input controls (for example, text, file,...) in the table for alignment, and all of these controls are in a form with enctype="multipart/form-data". However, when I run java servlet, it cannot recognize that it is a enctype="multipart/form-data". Is that because of I put the controls inside a table? Could you please answer me! Thanks a lot!
Sorry, I finally found the solution! what my stupid question is
13 years ago
JSP
Hi all,

I need your help. I have a problem that how to create a flexible jsp page depending on what user choose in the previous page? For example, depending on the value of the radio button in previous page, then the next page will have more input control such as: a file input, a text input, a select input....I intended to create many pages corresponding to the value of radio button chosen, but in case of there are many values of a radio button, I think this solution is not suitable. I would like to ask for any suggestion? Thank you very much!
13 years ago
JSP
Actually the action I did in the form means nothing. The response from server will depend on the "value" of the hidden input control name "action", then my servlet will manage the web depending on this value.

Sagar Rohankar wrote:

cho con wrote:I forgot to say that when I use Form with POST method and hidden input control which contains the action, the password still be showed in the URL, you have any suggest for my case?


Problem might be in your code. Post the same code here. You might doing something wrong with the FORM.



This is my code part, when I use the method="post" sometimes it makes my code doesnot work, it still stay at the login page, just like after clicking submit button, it still get the same action leading to the login page, it also makes me confuse


Specifically, I'm using org.apache.commons.fileupload package, so when saving a file to server, I know only giving the relative address such as: "/upload/", and this address belongs to a folder that we built web-app in server.



Sorry for my stupid question, I don't know how to give the absolute address of a folder in server in this case.
13 years ago
Hi all,

As I recognize that when we upload a file to server by servlet, it will be stored in a tempory place. Then these files may be deleted for some reason. I wonder how can we store them in a specific folder in server such as: "C:/fileupload/"? Does anyone have solution about this?

Thanks and regards,


13 years ago
I agree with you that the hardware can be changed later. There are many cases that would happen and we cannot cover all. I know this is not really a good solution. I just suppose it is stable for some time, and I do in the simplest way. How about the session id? Is it useful for my case?
I'm sorry for my persistence and my stupid question. I still wonder that can we use java applet combining with servlet to get this information?
13 years ago
Sorry, I would like to emphasize that in my case, I want to identify the computer not user. That's why I want to get this kind of information. As we know that on the internet environment, it's very difficulty to verify a user whether that he is the exact person that he stated to be (password, certificate....can be the solution but they can be steal on the internet and they are not really bind to the user). So I choose to bind the provided information from the user to computer specification. That's what I'm doing. But I don't know how to execute in servlet, or plain old java?
13 years ago
Actually I understand that user account does not solve my problem. It is only the minor detail to tie to the information that users provided. You're absolutely right that a user can use any computer to access the web application, but here I would like to limit the security problems as much as possible by identifying the client's specification. I am searching for solution about this but I haven't find the best solution. If anyone used to do this, please suggest me. Thanks you very much for your help!
13 years ago
So you meant that there's no way to get these kind of information except that we use Applet to run on client? I am new to Java, could you please explain me clearly?
13 years ago