wood burning stoves 2.0*
The moose likes JSP and the fly likes tree like structure in jsp ??????????help me out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "tree like structure in jsp ??????????help me out" Watch "tree like structure in jsp ??????????help me out" New topic

tree like structure in jsp ??????????help me out

Ra Sh

Joined: Jun 17, 2003
Posts: 10
I want to get the tree like structure
My requirement is that when I write any jsp and put it in webapps's any
folder I should get tree like structure of the folders in which I am putting my jsp.
Foe example I have structure like
----(Here goes my jsp which would make to get sructure)
When I type http://localhost:8080/rakesh_folder3/rakesh_subfolder2/jspname
I want output as
----my_other_file_1 (size of file) (time stamp)
----my_other_file_2 (size of file) (time stamp)
How should I proceed ???
Tx in advance
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
You can get the information of the url typed in as follows:
request.getRequestURL() - will return:
protocol + host + context path + servlet path + path info
example: http://localhost:8080/MyWebApp/securitytest/hello
request.getRequestURI() - will return:
context path + servlet path + path info
example: /MyWebApp/securitytest/hello
If you want to display a file tree, you can call the following methods:
returns: /MyWebApp
returns: /securitytest
returns: /hello
You could also parse the requestURI using the "/" character as a delimiter

Anthony W.<br />MCP, SCJP 1.4, SCJD, SCWCD 1.3, SCWCD 1.4, SCBCD
Consider Paul's rocket mass heater.
subject: tree like structure in jsp ??????????help me out
Similar Threads
Struts tree Directory
multiple URL mapping for one web app
Unable to see jsp output in eclipse
How to refer to a resource outside of the web application