File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Reading resource file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Reading resource file" Watch "Reading resource file" New topic

Reading resource file

sudharshan tettu
Ranch Hand

Joined: Jul 17, 2006
Posts: 126
How can i read a file in my action class. I have an xslt file i want to read it in my action class and parse an xml.Is there anyway i can do it?
I can keep the xslt in the same folder as that of action class or in web-inf .

Sudharshan Tettu
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32844

You mean your controller right? Not sure what a Spring action is.

This doesn't sound specific to Spring. You parse XML through your code. See this chapter.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
sudharshan tettu
Ranch Hand

Joined: Jul 17, 2006
Posts: 126
my query is nothing to do with xml parsing , but in general, how can i read a resource file from a bean?i put the bean and the file in the same package .... i want to read content from it and display it on the jsf page...
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Is this a Spring Framework question. We aren't seeing the Spring part in this question. It looks completely unrelated. This is the JavaRanch forum for Spring framework questions.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Reading resource file
It's not a secret anymore!