?
Solved

to convert a jsp file  to .txt file

Posted on 2003-03-30
10
Medium Priority
?
291 Views
Last Modified: 2010-08-05
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
Comment
Question by:shruths
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
10 Comments
 

Author Comment

by:shruths
ID: 8236520
helpme to convert a jspfile to text format
0
 
LVL 9

Expert Comment

by:nimaig
ID: 8236560
Have a look at the TAG available.

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

This would be helpful for you
0
 

Author Comment

by:shruths
ID: 8237162
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:nimaig
ID: 8237264
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
 

Author Comment

by:shruths
ID: 8243492
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
 

Author Comment

by:shruths
ID: 8243646
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
 
LVL 9

Accepted Solution

by:
nimaig earned 500 total points
ID: 8243822
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
 
LVL 9

Expert Comment

by:nimaig
ID: 8243990
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
 
LVL 35

Expert Comment

by:girionis
ID: 10060975
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Check out the latest tech news, community articles, and expert highlights in August's newsletter.
Hey fellow admins! This time, I have a little fairy tale for you. As many tales do, it starts boring and then gets pretty gory. I hope you like it. TL;DR: It is about an important security matter, you should read it if you run or administer Windows …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question