Link to home
Start Free TrialLog in
Avatar of shruths
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
Avatar of shruths
shruths

ASKER

helpme to convert a jspfile to text format
Have a look at the TAG available.

http://coldjava.hypermart.net/servlets/copytag.htm

This would be helpful for you
Avatar of shruths

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.
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("jspText");

Once you have the String, you can do whatever you want ... store it as txt file or send it to FLASH ...
Avatar of shruths

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
Avatar of shruths

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
ASKER CERTIFIED SOLUTION
Avatar of nimaig
nimaig
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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/copytag.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/copytag.tld</taglib-location>
  </taglib>


And in JSP, put
<%@ taglib uri="/WEB-INF/tld/copytag.tld" prefix="copytag" %>
Avatar of girionis
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