shruths
asked on
to convert a jsp file to .txt file
anybody out there pleeeeeeeeeeeeease help me out,
please help me out to convert a jsp file to a text file as i need to send this textfile data to a flash file.
i have no idea of how the format is of the textfile please do help me in writing the format.
Thank you in advance,
shruths
please help me out to convert a jsp file to a text file as i need to send this textfile data to a flash file.
i have no idea of how the format is of the textfile please do help me in writing the format.
Thank you in advance,
shruths
Have a look at the TAG available.
http://coldjava.hypermart.net/servlets/copytag.htm
This would be helpful for you
http://coldjava.hypermart.net/servlets/copytag.htm
This would be helpful for you
ASKER
dear nimaiq,
i went thro. the site address but found it unclear could u please make it clear for me.
actually i want to send these values in the .txt format to the FLASH mx file. please help me.
thank u.
i went thro. the site address but found it unclear could u please make it clear for me.
actually i want to send these values in the .txt format to the FLASH mx file. please help me.
thank u.
Copy tag can be used in your .jsp page for storing the rendered JSP in any variable.
Example
<def:Copy id="jspTxt" scope="session">
...
...<!-- your JSP code is here -->
...
</def:Copy>
So, while rendering/running the JSP page, any HTML/JS/JSP/JAVA code within the tag '<def:Copy.../>' would be stored in the variable 'jspText' which would be available in the session with the name 'jspText'
eg.
String txt = session.getAttribute("jspT ext");
Once you have the String, you can do whatever you want ... store it as txt file or send it to FLASH ...
Example
<def:Copy id="jspTxt" scope="session">
...
...<!-- your JSP code is here -->
...
</def:Copy>
So, while rendering/running the JSP page, any HTML/JS/JSP/JAVA code within the tag '<def:Copy.../>' would be stored in the variable 'jspText' which would be available in the session with the name 'jspText'
eg.
String txt = session.getAttribute("jspT
Once you have the String, you can do whatever you want ... store it as txt file or send it to FLASH ...
ASKER
hi nimaig,
i used the above told format but it gives the error saying taglib not found.it is in the jar format.,i have put that file in the jsp library folder, but still i have the problem.
i have not followed where i have to add
string txt=session. getAttribute("jspText");
and another doubt for the copy id="jspTxt" should it always be 'jspTxt' or anything else Sir?
thank you
i used the above told format but it gives the error saying taglib not found.it is in the jar format.,i have put that file in the jsp library folder, but still i have the problem.
i have not followed where i have to add
string txt=session. getAttribute("jspText");
and another doubt for the copy id="jspTxt" should it always be 'jspTxt' or anything else Sir?
thank you
ASKER
hi nimaig,
i used the above told format but it gives the error saying taglib not found.it is in the jar format.,i have put that file in the jsp library folder, but still i have the problem.
i have not followed where i have to add
string txt=session. getAttribute("jspText");
and another doubt for the copy id="jspTxt" should it always be 'jspTxt' or anything else Sir?
thank you
i used the above told format but it gives the error saying taglib not found.it is in the jar format.,i have put that file in the jsp library folder, but still i have the problem.
i have not followed where i have to add
string txt=session. getAttribute("jspText");
and another doubt for the copy id="jspTxt" should it always be 'jspTxt' or anything else Sir?
thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
id can be anything ... not necessary 'jspText' ... it is the name corresponding to which a string would be stored in session.
You need to do this anywhere after the tag ends i.e. '</def:Copy id>'. This would get you the full text stored in session.
string txt=session. getAttribute("jspText");
For using Tag you need to use the .jar and the .tld files
Put the jar in
\WEB-INF\lib folder
And put the .tld file in say '\WEB-INF\tld'
In web.xml, put the following entry
<taglib>
<taglib-uri>/WEB-INF/copyt ag.tld</ta glib-uri>
<taglib-location>/WEB-INF/ tld/copyta g.tld</tag lib-locati on>
</taglib>
And in JSP, put
<%@ taglib uri="/WEB-INF/tld/copytag. tld" prefix="copytag" %>
id can be anything ... not necessary 'jspText' ... it is the name corresponding to which a string would be stored in session.
You need to do this anywhere after the tag ends i.e. '</def:Copy id>'. This would get you the full text stored in session.
string txt=session. getAttribute("jspText");
For using Tag you need to use the .jar and the .tld files
Put the jar in
\WEB-INF\lib folder
And put the .tld file in say '\WEB-INF\tld'
In web.xml, put the following entry
<taglib>
<taglib-uri>/WEB-INF/copyt
<taglib-location>/WEB-INF/
</taglib>
And in JSP, put
<%@ taglib uri="/WEB-INF/tld/copytag.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- Points to nimaig
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
girionis
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
- Points to nimaig
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
girionis
EE Cleanup Volunteer
ASKER