G
getsanjay.sharma
Hello to all Java programmers out there.
The task I am trying to do here is to serve or access files which
belong to my web application (i.e. present in the WEB-INF/xml
directory) in a servlet. I could have hardcoded the path but what I am
looking for is a solution which employs relative paths.
Attempting to do new File("./xml/Data.xml") doesn't yield the desired
results considering that it starts looking for this folder structure
inside the bin directory of my App server.
Also, would it be a good programming / design practice to format the
data at the server and then serve the client, relieving the client of
knowing what attributes it should be looking for in the response in
case of an Ajax XML response or to send raw data in the form of XML to
the client and let it figure out how the data should be displayed?
Thanks and regards,
S T S
The task I am trying to do here is to serve or access files which
belong to my web application (i.e. present in the WEB-INF/xml
directory) in a servlet. I could have hardcoded the path but what I am
looking for is a solution which employs relative paths.
Attempting to do new File("./xml/Data.xml") doesn't yield the desired
results considering that it starts looking for this folder structure
inside the bin directory of my App server.
Also, would it be a good programming / design practice to format the
data at the server and then serve the client, relieving the client of
knowing what attributes it should be looking for in the response in
case of an Ajax XML response or to send raw data in the form of XML to
the client and let it figure out how the data should be displayed?
Thanks and regards,
S T S