|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
I want to create a serlvet which checks for the existence of a JSP file. I am kind of new to JSP/Servlet, so I don't know if I am doing it correctly. This is the code I have to run this check:
public boolean isURLValid(String area, String section, String page){ File areaFile = new File("/repositorium/jsp/" + area + "/"); File sectionFile = new File("/repositorium/jsp/" + area + "/" + section + ".jsp"); File pageFile = new File("/repositorium/jsp/" + area + "/" + page + ".jsp"); if (areaFile.isDirectory() == true && sectionFile.isFile() == true && pageFile.isFile() == true){ return true; } else { return false; } } This does not work for me. I am trying to check for the existence of this file using an absolute path, starting from the application's root, called 'repositorium'. Can someone give me some feedback on this? Thanks in Advance!
__________________
Edgar Castanedo |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > File Existence |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|