• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to specify relative path in servlet.

 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

i need to specify the relative path of the *.jasper file in a servlet which is in MY_WEB_APPLICATION/WEB_INF/classes/com/lt/voms/report/Servlet.classes

the jasper file is in MY_WEB_APPLICATION/jrxmls/*.jasper

How will i use this *.jasper file in my servlet. Some one please help me.

servlet is getting called and i am getting FileNotFoundException.

Thanks In Advance,

Bennet Xavier. X
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can do this by adding this in your web.xml file.

//web.xml amendments

 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ujjwal soni,

Please understand my problem.

i need to specify the path of the jasper file in the method as a argument, that method will create a report for me.

Now, how should i mention the path of that file in the method.

i dont think its possible in the way you have specified, if it is possible how will i mention the path in method.

do reply.

Thanks In Advance
Bennet Xavier. X
 
Ryan Beckett
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- returns the virtual path to your resource
 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ryan Beckett,

if i am developing the application in windows and deploying in unix environment, will this not make any problem.

Bennet Xavier. X
 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give the path with forward slash.
It will work on both Windows and Unix.
 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Thank you very much.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Multiple post http://www.coderanch.com/t/440997/Web-Component-Certification-SCWCD/certification/servlet-use-file-which-kept

Please do not cross post and waste our time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic