Link to home
Start Free TrialLog in
Avatar of equentin
equentin

asked on

searching for string within a string

following on from a previous question, i need to extract the folder and filename from request.getRequestURI()

ie "/folder/filename.jsp": string1 = "folder"; string2 = "filename"

and also i need to know if there is no folder (ie the file is in the root)

any thoughts?

Avatar of jimmack
jimmack

Have a look at getPathInfo() and getPathTranslated() in HttpServletRequest.

AFAIK, getPathInfo() will return null if the file is in the root.
ASKER CERTIFIED SOLUTION
Avatar of jimmack
jimmack

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks again ;-)