Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Being able to view a directory when i click on a row  RSS feed

 
Ajit Krsna Das
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before we begin, please realise I only have 2 days worth of JSP knowledge. Im tasked to create a JSP page that allows users to view a list of files, and subfolders based on restrictions according to their login id. They need to be able to create directories, rename files, and delete files that belong to the directory they are restricted to. I managed to list all files that they have access to into a table. What I need help with is, how do I allow the user to select a directory and then list all the files in there into the same table. My block of code so far:
<edit> Nevermind my earlier question, my codes now look as follows. How would i go about deleting a selected file from the table? I already have a ?file parameter for each row created with the filename. How would i go about parsing it to my delete.jsp to actually carry out the delete function? It's really frustrating because I have 0 background with this and despite me wanting to know how to do this properly and know the basics well, I just don't have the time because this practical is due Monday. Your help once again, is most duely appreciated!!



My delete.jsp is as follows ->


Error I am getting :

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.delete_jsp
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:168)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

java.lang.ClassNotFoundException: org.apache.jsp.delete_jsp
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:162)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.12 logs.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you are just starting out with JSP it is important that you start off using good practices and establishing good practices right off the bat. Putting Java code into a JSP is a bad bad practice that has been discredited for almost 10 years now. Don't do it now. Don't do it ever.

Learn how to write JSP the correct and modern way with the JSTL and the EL.

The cause of a class not found error is always that the target class cannot be found on the container's classpath. Did you places all the classes in the WEB-INF/classes hierarcy, and the jar files in WEB-INF/lib?
 
Ajit Krsna Das
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response! Yes I realise it's better to start off with good practices but the urgency outweighs it atm. I know where your coming from and I thank you for your advice.

If i were to delete a file from the table created, how would I go about doing it properly in JSP? I know nothing about JSTL and EL and am afraid I wouldn't have time to fully learn it. Kindly offer me advice on a beginner level as to
how I can go about achieving my predicament.

Any help is greatly appreciated!

<edit>

I managed to solve it. Error was in


As i copied it from a website, the quotes used were not recognised But I now successfully can delete a file! Thank you guys!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!