Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

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
0
shruths
Asked:
shruths
  • 4
  • 4
1 Solution
 
shruthsAuthor Commented:
helpme to convert a jspfile to text format
0
 
nimaigCommented:
Have a look at the TAG available.

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

This would be helpful for you
0
 
shruthsAuthor Commented:
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.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
nimaigCommented:
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 ...
0
 
shruthsAuthor Commented:
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
0
 
shruthsAuthor Commented:
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
0
 
nimaigCommented:
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" %>
0
 
nimaigCommented:
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" %>
0
 
girionisCommented:
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
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now