|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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?
|
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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..... |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Can't display large amounts of text - help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|