• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Display the contents of folder when the link is clicked

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi...

I have to display the folder names on a page. When one of the folder name is clicked the contents of the folder should be displayed.

Thanks in advance...
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where's your code? What problems are you having with it?
 
Debasmita Dash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Where's your code? What problems are you having with it?




I am able to display the folder names as hyper links using the "a href" tag.
<td><a href="DisplayContents.jsp"><%=attr.getName(object_name)%></a></td>
attr.getName(object_name) gives the folder name.But when I click on the folder name it gives NullPointerException
since the folder name is not accessible to the DiplayContents.jsp page.Basing on the folder name clicked I have to diplay the contents of that folder.

thanks...
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, a couple of things.

First, it looks as if you are still using scriptlets. Stop. Use the JSTL and EL.

Also, you are submitting directly to a JSP. No good. Your first stop on any request should be a servlet controller. In that controller you can fetch the information to display, in this case use file I/O to obtain the files and folder names, and forward to the JSP for display.

Perhaps this article will help make that clear.
 
Debasmita Dash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I need to retreive the folder name selected that will be fetched to a java bean(ActionForm) which in turn will be used by the Action class.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh. You're using Struts. OK, this has been moved to the Struts forum.
 
Debasmita Dash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bibeault,
Thanks a lot for the instant reply and help.....
 
Debasmita Dash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Can anyone help regarding this topic....

Thanks in advance...
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What code is running behind to retrieve the folder contents?
 
Debasmita Dash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks for the concern...
Solved the issue....now able to retreive the contents
But further I want to dislay the content of the document through a window that will pop upon clicking on the link.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic