Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old November 30th, 2001, 02:58 AM
coach coach is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 94 coach User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 10 sec
Reputation Power: 7
Can't display large amounts of text - help

I have a form that allows a user to cut and paste text into an HTML text area and then submit to a second page which will display what they have submitted.

I am using request.getParameter(""); to retreive the submitted text. My problem is if the user cuts and pastes a large amount of text and then submits - it breaks

If the text isn't quite as long - it submits fine.

Is there another way to capture large chunks of data that is submitted through a form? (like the size of a magazine article)

It's like the request.getParameter("") will only accept a certain amount of data and then break.

Anyone heard of this?

Any ideas?

Thanks
Coach
__________________
A gentle push and a mild arc -
And the cowhide globe hit home

Hot Rod Hundley

Reply With Quote
  #2  
Old December 7th, 2001, 03:20 PM
wolfespawn wolfespawn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 68 wolfespawn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via AIM to wolfespawn
if you are passing it in a form and your METHOD=POST, it shouldnt be truncating... if you arent specifying, or METHOD=GET, there is a max value allowed in the URL... are you using POST and it is still getting truncated?

Reply With Quote
  #3  
Old December 7th, 2001, 03:26 PM
coach coach is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 94 coach User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 10 sec
Reputation Power: 7
using POST in the method -
I think it has to do with chars that get passed when you cut or paste.

Dunno - still stumped.

Coach

Reply With Quote
  #4  
Old December 14th, 2001, 10:02 PM
midntrdr midntrdr is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 45 midntrdr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
try throwing it in the session. If you have size issues still, put it in a vector and then in the session.

Just a thought.....

Reply With Quote
  #5  
Old December 15th, 2001, 01:27 PM
coach coach is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 94 coach User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 10 sec
Reputation Power: 7
How would a vector help?

All the information that is posted by the form is already passed to a session. You recommend a vector first and then a session?

How would a vector help in this situation? I think the issue is that when special chars are included in a submitted form - JSP doesn't like it. I've seen this before with another application. Funny thing is it only occurs with rather large amounts of text.

But I can't even get the text into a session var because the form crashes first before I declare a session var.

Any example code?

Thanks

Mark

Reply With Quote
  #6  
Old December 23rd, 2001, 01:31 PM
oscagne oscagne is offline
Java Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 5 oscagne User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
For clarification you need your serlvet to generate some HTML like:

<HTML>
<FORM METHOD=POST>
<TEXTAREA NAME=TEST></TEXTAREA>
<INPUT TYPE=SUBMIT>
</FORM>
</HTML>

Then you need to override the doPost method of HttpServlet, and not worry about the doGet. Your doPost could be like this

public void doGet(HttpServletRequest rq, HttpServletResponse rs)
throws IOException, ServletException{
String testString=req.getParameter("TEST");
}

And now testString contains to contents of your text area. I haven't tested this, but I'm sure I've done this plently of times in the past. Coach...If your having still having trouble, re-post (maybe with some of your code) and I'll have a look. But it sounds to me like either
1) you are not putting in the Method=post
OR
2) you are servicing the requests with the doGet

Hope this was of some help

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Can't display large amounts of text - help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway