| | |
URL Validation
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
You should always allow manual entry as well.
It works a LOT faster if the user knows what he wants to enter.
But I'd not validate paths at all. The client is solely responsible for that, all the server should do is gracefully handle the situation in which the file doesn't exist.
And NEVER let the user enter a path and/or filename existing on the server and have the server do something with that file. That's a massive breach of security.
It works a LOT faster if the user knows what he wants to enter.
But I'd not validate paths at all. The client is solely responsible for that, all the server should do is gracefully handle the situation in which the file doesn't exist.
And NEVER let the user enter a path and/or filename existing on the server and have the server do something with that file. That's a massive breach of security.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
yes, having a button as an optional way to fill the file location is fine.
But you should not require the use of that button by not providing an input field for manual entry.
Pressing a button, launching a popup, filling the location in that, clicking another button, that's 4 steps to fill the file location.
Just filling it directly is a single step, far faster.
Maybe not that important on a hobby site where people may use it once a month or so, but on a professional intranet application where it's used by many people many times a day it becomes first a major annoyance and then reason for the application to require changing to improve performance.
Also, one should never rely solely on clientside validation (which forcing the user to select an option from a popup dialog effectively is), as someone will come who circumvents that in some way.
But you should not require the use of that button by not providing an input field for manual entry.
Pressing a button, launching a popup, filling the location in that, clicking another button, that's 4 steps to fill the file location.
Just filling it directly is a single step, far faster.
Maybe not that important on a hobby site where people may use it once a month or so, but on a professional intranet application where it's used by many people many times a day it becomes first a major annoyance and then reason for the application to require changing to improve performance.
Also, one should never rely solely on clientside validation (which forcing the user to select an option from a popup dialog effectively is), as someone will come who circumvents that in some way.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
•
•
Join Date: Mar 2005
Posts: 13
Reputation:
Solved Threads: 0
HI
Thankz for your replies. Actually we r developing an Intranet application in which the user should specify the resource files and the result files folder which is in the server.So i need a validation to validate the entered file path is correct and available. Now i got another solution.tht is
/* to hold the file path */
StringBuffer localSBFilePath = new StringBuffer( File.separator);
/* to hold the boolean value for long term files folder exists */
boolean localIsLongTermFolderExists = false;
/* to hold the long term files folder */
String localLongTermFilesFolder = null;
/* to hold the FILE */
File localFile = null;
/* get the long term files folder */
localLongTermFilesFolder = PrimaryServerAdminPKForm.getPServerStorage();// Here PrimaryServerAdminPKForm is an form bean using Struts.
/* append the file path*/
localSBFilePath.append(localLongTermFilesFolder);
localFile = new File(localSBFilePath.toString());
/* check the folder exists in the given path */
localIsLongTermFolderExists = localFile.isDirectory();
/* if not throw exception */
if (!(localIsLongTermFolderExists))
{
throw new AppsCustomException("error.PrimaryServerAdminPKForm.primaryserver.FileNotFound");
}
Thankz for all
cheers mite
Rajesh G.
Thankz for your replies. Actually we r developing an Intranet application in which the user should specify the resource files and the result files folder which is in the server.So i need a validation to validate the entered file path is correct and available. Now i got another solution.tht is
/* to hold the file path */
StringBuffer localSBFilePath = new StringBuffer( File.separator);
/* to hold the boolean value for long term files folder exists */
boolean localIsLongTermFolderExists = false;
/* to hold the long term files folder */
String localLongTermFilesFolder = null;
/* to hold the FILE */
File localFile = null;
/* get the long term files folder */
localLongTermFilesFolder = PrimaryServerAdminPKForm.getPServerStorage();// Here PrimaryServerAdminPKForm is an form bean using Struts.
/* append the file path*/
localSBFilePath.append(localLongTermFilesFolder);
localFile = new File(localSBFilePath.toString());
/* check the folder exists in the given path */
localIsLongTermFolderExists = localFile.isDirectory();
/* if not throw exception */
if (!(localIsLongTermFolderExists))
{
throw new AppsCustomException("error.PrimaryServerAdminPKForm.primaryserver.FileNotFound");
}
Thankz for all
cheers mite
Rajesh G.
•
•
•
•
Originally Posted by server_crash
I'm a little confused here. Lets say this is an upload page were the user enters the path or clicks the browse button, whichever he/she prefers. How exactly do you get that file off their computer since there is so many restrictions with java?
![]() |
Similar Threads
- URL Validation (PHP)
- XHTML with PHP validation ??? (HTML and CSS)
Other Threads in the JSP Forum
- Previous Thread: Help:show dynamic JSP field value into PDF from
- Next Thread: Mail attachments
| Thread Tools | Search this Thread |
Tag cloud for JSP
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient project read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write






