princehyderabad
asked on
JSP InputStream Help
hi
Can anyone help me on XSL transformer path using JSP. I have this JSP
<%
Transformer transformer = tFactory.newTransformer(ne w StreamSource("../../java/M SquaredWeb /styleshee ts/right_l ive.xsl") );
%>
How can I get rid of only partial path "../../java/MSquaredWeb" which is hardcorded and get dynamic content name.
I was told to use this belwo and get ... but have no idea how to use....
ServletContext context = getServletContext();
InputStream is = context.getResourceAsStrea m("/styles heets/<nam e of your stylesheet>");
Only this should be harded coded "stylesheets/right_live.xs l" and rest should be the content name whatever Tomcat is using.
plz help
Can anyone help me on XSL transformer path using JSP. I have this JSP
<%
Transformer transformer = tFactory.newTransformer(ne
%>
How can I get rid of only partial path "../../java/MSquaredWeb" which is hardcorded and get dynamic content name.
I was told to use this belwo and get ... but have no idea how to use....
ServletContext context = getServletContext();
InputStream is = context.getResourceAsStrea
Only this should be harded coded "stylesheets/right_live.xs
plz help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
actually...thinking about it, I am not sure where the context is set to for jsps... You may need to move your "stylesheets" directory into WEB-INF/classes