Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSF
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JSF
Usage of Tomahawk SourceCodeServlet
Shasi Mitra
Ranch Hand
Posts: 101
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Can anyone tell me why do we use org.apache.myfaces.shared_tomahawk.util.servlet.SourceCodeServlet? Is it mandatory?
Rahul Santha
Greenhorn
Posts: 12
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Don't know.
But it is not a mandatory, unless you are trying to use the tomahawk library.
Thanks!<br />Rahul, IOWA
Shasi Mitra
Ranch Hand
Posts: 101
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm using many of the tomahawk's compnonents..i read somewhere that we have to configure the source code servlet..but m not sure why..can anyone tell me..
Pari Gandhi
Greenhorn
Posts: 10
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The SourceCodeServlet is used to serve the source code (
jsp
) as a html page.
For Example :
http://www.irian.at/myfacesexamples/masterDetail.jsp.source
This is what the
servlet
does:- (Nothing fancy)
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { String webPage = req.getServletPath(); // remove the '*.source' suffix that maps to this servlet int chopPoint = webPage.indexOf(".source"); webPage = webPage.substring(0, chopPoint - 1); webPage += "p"; // replace jsf with jsp // get the actual file location of the requested resource String realPath = getServletConfig().getServletContext().getRealPath(webPage); // output an HTML page res.setContentType("text/plain"); // print some html ServletOutputStream out = res.getOutputStream(); // print the file InputStream in = null; try { in = new BufferedInputStream(new FileInputStream(realPath)); int ch; while ((ch = in.read()) !=-1) { out.print((char)ch); } } finally { if (in != null) in.close(); // very important } }
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Java Bean and STruts
Java Bean and STruts
Overriden exception
Adding Calender Control
taglib element in web.xml
More...