File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ra Sh
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
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
webapps
--rakesh_folder1
--rakesh_folder2
--rakesh_folder3
---rakesh_subfolder1
---rakesh_subfolder2
----(Here goes my jsp which would make to get sructure)
----my_other_file_1
----my_other_file_2
When I type http://localhost:8080/rakesh_folder3/rakesh_subfolder2/jspname
I want output as
--rakesh_folder3
---rakesh_subfolder2
----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
Rakesh
 
Anthony Watson
Ranch Hand
Posts: 327
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
request.getContextPath()
returns: /MyWebApp
request.getServletPath()
returns: /securitytest
request.getPathInfo()
returns: /hello
You could also parse the requestURI using the "/" character as a delimiter
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic