[jboss-user] [Installation, Configuration & DEPLOYMENT] - Connect app to static content folder

oneworld95 do-not-reply at jboss.com
Wed Mar 4 11:06:19 EST 2009


Hi. I'm new to JBoss and have installed version 4.2.3.GA on my WinXP Pro system to match our server. The Java servlet needs to write an uploaded file to a folder on my machine. The app's is located in this folder:

C:\jboss\jboss-4.2.3.GA\server\default\deploy\premupload.war

Its structure is like this:
...\premupload.war
  |     \uploads\
  |     \WEB-INF\
  |     upload.jsp

The upload folder (which is off the root of the app) is defined in the web.xml file as this:

  <context-param>
  |     <param-name>UploadDirectory</param-name>
  |     <param-value>/uploads/</param-value>
  |   </context-param>

I try to fetch the upload folder using this line in the servlet: 

String uploadDirectory = this.getServletContext().getInitParameter("UploadDirectory");

The app blows up with the following error referring to the above line:

java.lang.NullPointerException
  | 	org.unctv.fileupload.UploadHandler.doPost(UploadHandler.java:47)
  | 	javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
  | 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  | 	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

How do I refer to the upload directory? Does it need to be outside of the premupload.war folder? Your guidance is much appreciated. Thanks.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214947#4214947

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4214947



More information about the jboss-user mailing list