How to restrict text area in jsp

I am using jsp and struts framework for developing a front end application.I have a text area whose width I restricted by specifying the rows and columns.When I enter large lines of data,while entering its not expanding but on reload of page by save or any other operation its expanding beyond the number of rows and columns.
Could somebody help me out in this

I've ran into the same issue with struts and used the plain html tag (ie: not struts) and used the form bean to populate the contents. This way will allow you to use all of the 'missing' attributes in the Struts 1.0 taglibs, and this also works well with other html tags.
Here's a workaround that I used:
<textarea wrap="soft" rows="5" cols="50">
<bean:write name="someStrutsFormBeanName" property="someStrutsFormBeanProperty"/>
</textarea>
'someStrutsFormBeanName' will be one of the <form-beans> element names located in the struts-config.xml, and in the action I do have the bean set to session scope. Another way is to put the textarea's body into the request and pass it around from page to page in the request or session, not very clean nor desirable, but it works...

Similar Messages

  • How to call text file in jsp

    Hi all,
    I can call html or jsp file from jsp file, but how can I call text file in jsp, I put my text file same lever asmy jsp file it don't work!
    where I should put the text file??
    thank you

    mary,
    since you knew the file name ,when clicked in name send to server,read the file and write to servlet outputstream.
    I think this would help you.
    If anything wrong in mycode ..forums will help you further
    BufferedInputStream bis=null;
    BufferedOutputStream bos=null;
    int bytesRead=0;
    byte buff[]=new byte[1024];
    File f=new File(test.txt);
    try{
         bis= new BufferedInputStream(new FileInputStream(f));
         bytesRead=bis.read(buff,0,buff.length);
         if(bytesRead!=-1){
              // create a BufferedOutputStream from ServletOutputStream
              bos=new BufferedInputStream(response.getOutputStream());
              do{
                   bos.write(buff,0,bytesRead);
              }while((bytesRead=bis.read(buff,0,buff.length))!=-1)
    }catch(Exception e){
         ////error handling
         }

  • How to autoresize text area horizontally?

    I want to resize text area horizontally when user enter text into it.
    I know how to do resize vertically.
    Any idea how to resize horizontally?

    What sort of text is it? Annotation, page contents, annotation?
    (It would be good if someone could move this to the Acrobat SDK forum)

  • How to display text file in JSP?

    Hi,
    I am new to servlet/JSP/java programming.
    I have been able to download a file using ftp. I dont know who to display it in JSP.
    Here is my code. Any help will be appreciated...
    <%@ page import="java.util.*" %>
    <%@ page import="java.lang.*" %>
    <%@ page import="java.net.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="com.dmhistory.*" %>
    <html>
    <head>
    <title>Untitled</title>
    </head>
    <body>
    <%
    byte[] bytes = new byte[4096];
    URL theUrl = new URL("ftp://user:passwd@host/migr/Movers_for_Ora8/BG/logs/FLD-PAC3-20020311.log");
    BufferedInputStream in = new BufferedInputStream(theUrl.openStream());
    BufferedOutputStream outstream = new BufferedOutputStream(new FileOutputStream( new File( "D:/temp/log.txt" )));
    int pos = in.read( bytes );
    while ( pos != -1) {
    outstream.write( bytes, 0, pos );
    pos = in.read( bytes );
    %>
    <%
    in.close();
    %>
    DONE!!!
    </body>
    </html>
    How can i display this downloaded file in the browser?
    I want to display it in the original format i.e which new line and carriage returns...line by line..
    Thanks,

    Hi,
    I finally go it to display. but now I have new problem. The browser shows the text without the /n/r.
    But when I view the source using 'view->source', if see that the text has got proper format with newline and carriage returns.
    Any ideas how to display it correctly in the browser?
    <%
                   URL theUrl = new URL("ftp://user:pwd@host/migr/Movers_for_Ora8/BG/logs/FLD-PAC3-20020311.log");
                   //URL theUrl = new URL("ftp://dbcmaint:[email protected]/migr/Movers_for_Ora8/SNP/logs/SNP-PAC2-20020314.log");
                   URLConnection uc = theUrl.openConnection();
                   InputStream content = uc.getInputStream();
                   BufferedInputStream in = new BufferedInputStream (content);
                   LineNumberReader lnr = new LineNumberReader (new InputStreamReader (in));
                   String tempStr = "";
                   String str = "";
                   while ((tempStr = lnr.readLine()) != null) {
                   str += (tempStr);
                        %>
                        <%=tempStr%>
                        <%tempStr = "";
                        %>
                   <%
                   in.close();
                   lnr.close();
              %>
    Thanks

  • How to Restricting Buisness area in same company Code?

    Hi All,
    Can anybody tell me whether is it possible to restrict users from accessing diffrent buisness area within the same company code?
    regards,
    Amit

    Hi Amit,
    Use the following objects to restrict the access for Business area's:
    1. A_S_GSBER "Asset Master Data Maintenance: Company Code/Business Area"
    Object class is AM [Asset Accounting]
    2. J_3GABRLST "Call CEM Settlement List for Organizational Units" ---> Object class is "J3GD" [Industry Business Solutions - CEM]
    and there are other auth. objects for Bus.area's which might help you :
    1. F_BKPF_GSB
    2. F_FDES_GSB
    3. F_FDSB_GSB
    4. F_FDSR_GSB
    5. A_IMA_GSB
    6. A_IMPR_GSB
    Regards,
    Ashok
    "Award points if it is helpful"

  • How to restrict pan area in oracle map viewer?

    Hi,
    I have added map to Jpanel,Now I want to restirct panning functionality of map to a defined area.Because when I keep on panning to extreme East or West side even when my map boudaries are panned completely,I can still drag the map and So,after some point my map is lost completely(or its panned completely to extreme right or left) and I can see only white screen on my Jpanel.
    Please can anyone suggest me an API or any alternative solution to achieve this.
    Thanks.

    Hi,
    using oraclemaps javascript API you can use mapview.enableMapBoundConstraint(true); Your map will be bound the the tilelayers boundingbox...
    hope that helps.
    dominik

  • How to restrict a user to eneter limited characters(Urgent)

    Hi friends,
    Im creating a text area in jsp, now i need to keep a restriction to the user to enter only 1000 chararacters
    Where shall i modify the code, so that the user can enter upto 1000 characters.
    Please help me out.
    <TD>
    <html:textarea
    styleId = "spclTxt" name="wiForm" property="spclTxt"
    cols="125" rows="7" onblur="autoValidate(this)"
    onkeydown="SomethingMightHaveChanged();"/>
    </TD>
    Thanks

    hi , check this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <script language="javascript" type="text/javascript">
    function limitText(limitField, limitCount, limitNum) {
         if (limitField.value.length > limitNum) {
              limitField.value = limitField.value.substring(0, limitNum);
         } else {
              limitCount.value = limitNum - limitField.value.length;
    </script>
    </HEAD>
    <BODY>
    <form name="myform">
    <textarea name="limitedtextarea" onKeyDown="limitText(this.form.limitedtextarea,this.form.countdown,100);"
    onKeyUp="limitText(this.form.limitedtextarea,this.form.countdown,100);">
    </textarea><br>
    <font size="1">(Maximum characters: 100)<br>
    You have <input readonly type="text" name="countdown" size="3" value="100"> characters left.</font>
    </form>
    </BODY>
    </HTML>

  • Adding Text Area on Infotype

    Hi,
    I would like to know how to add text area on the Infotpe 0102,so the user can add 1 or n lines of text, I know we can create additional Field from PM01, I dont how to do this.. Can anyone help me ..
    Thanks
    Kishore

    Hi,
    Why do you want create an additional field? Did you try the Edit--> Maintain Text option? This enables the User to enter any number of lines of free text.
    Good Luck,
    Suresh Datti

  • How to restrict header text changes in sales order level

    Dear Experts,
    how to restrict header text changes in sales order level change mode
    thanks

    Hello Chandu,
    how to restrict header text changes in sales order level change mode
    In order to restrict changes to Sales Order Header Text, the appropriate User Exit would be USEREXIT_MOVE_FIELD_TO_TVCOM_H. With the help of ABAPer, you can include the simple logic on the basis of Header Text type such that whenever any changes are incurred on the Sales Order header text, updates would be prevented.
    Please try out this approach and let us know your latest observation on this issue.
    Regards,
    Sarthak

  • How to Align test in Text Area?

    Someone please show me how to align text in text Areas...

    You can't (not without rewriting major portions of JTextArea)
    Here's a link which may help (use JTextPane instead)
    http://forum.java.sun.com/thread.jsp?forum=57&thread=342068
    http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20258546.html

  • On click of lov new jsp page which has only text area for adding comment

    hi all ,
    please help me to do this task. on click of lov new jsp page should be opend which has only text area for adding comment and upon clicking submit on the jsp page the value entered on the textarea should fall on the text field of lov.
    with regards
    prabhakaran.p

    The only reason I see for such a requirement is "Notes" require more space for entering a detailed note and would be inconvenient to write it in small single-line text input box. But, still in this case, getting the entered text back to the page and displaying it will have the same inconvenience of reading it from that field. And, I still think that removing one amongst the two (text field or image link) would be good, design wise.
    Anyway, did u try the following:
    1. Add a flow layout to the table bean
    2. Add text input and image item to the flow layout.
    3. Attach the notes page as the destination uri for the image.
    Did u start the working on it, let us know how far did u reach so that we can guide you through from that point.

  • Text wrap for a paragraph: How to define the width of a Text box /  active text area? I simply need a longish text to wrap within the frame!

    Hello, I've been searching for a good while in the forums now, but have found no solution or real mention of the problem – I hope some of you can help.
    I want to very simply layout a text between scenes, a slightly longer text that wraps within the frame margins. Here's an example of how I want it to look:
    Now, I couldn't for the life of me get the Custom Text to behave like that, as there are no parameters to set for the width of the text area. The Text Size, yes, along with the Tracking, Baseline and all that, but the width of the text box, no. The above was created by customizing one of the other Text Generator presets that happened to be left aligned.
    However, this preset has a fade in/fade out transition, which I do not want. There's no way to remove this transition as it seems integrated into the Text Generator (meaning they are not really presets, but separate kinds of Text objects? Very silly.)
    So I am asking you: Is there any way to get the Custom Text generator to behave like that? Just a text paragraph as above. Below you'll see all I can manage with the diffferent Custom Text parameters. Any kind of repositioning and resizing of the text just changes the position and size of the frame – but the actual text items are just cropped off where they extend out of that frame. Apparently the bounding box for the text is just some default length, and I can't find any way to adjust the width. See below my different attempts.
    The same text pasted into a Custom Text generator clearly extends outside the frame:
    Here Transform just moves – or resizes – the video frame that the Text Box exists inside:
    The Crop gives similar results, and of course Distort doesn't get me closer to what I need, either. There should be simply a Text Box Width parameter to set somewhere, but if it exists they have hidden it very well. How do you do it?
    Thanks for any help, this is a silly problem, but one of now many trivial problems that amount to me growing quite dissatisfied with FCPX. Hopefully I've just overlooked something.
    All the best,
    Thomas

    Thomas...same kind of crap here.
    I used Custom Text - entered a sentence, hit return, entered another.
    Set to 72 pt.
    The default alignment is centred - I want left aligned text...the text start point stays at the centre of frame and the sentence runs off the edge of the bounding box.
    There is no settings in the Text or Title inspector dialog to correct that!
    Using Transform will not sort it!

  • More than one text area on a slide master... how?

    Is it possible to define more than one text area on a master slide? If so how?
    I want to have a layout with two columns of text - a fairly common layout in presentation packs - but can't persuade Keynote to accept this as a layout for a template. I realise that there can only be one 'body' area, but any attempt to produce a 'fake' second body area fails - whether I put in a text box or a shape with text in.
    If I put it in as a text box, I can't put a limit on how big the box is.
    If I put it in as a shape with text in, when I try to enable the shape as a text placeholder, it forces the whole text in box to have same format as 'top level' outline.
    Any ideas?

    If you want two columns of text, why not set up the Body textbox with two columns? Select the Body textbox on the slide master, then in the Text Inspector, in the Columns tab, set however many columns you want.

  • Hello, I am trying to use a photo,that I've opened up in pages on a blank landscape, taken from my camera roll and use it as album cover art. All the custom text's will not paste when I copy.  Pic and texts are saved as a PDF, how can I paste the doc ?

    Hello, I am trying to use a photo,that I've opened up in pages on a blank landscape, taken from my camera roll and use it as album cover art. All the custom text's will not paste when I copy.  Pic and texts are saved as a PDF, how can I paste the doc ?

    Hello, I am trying to use a photo,that I've opened up in pages on a blank landscape, taken from my camera roll and use it as album cover art. All the custom text's will not paste when I copy.  Pic and texts are saved as a PDF, how can I paste the doc ?

  • I just bought a second iPhone for my business... I used my existing apple account and now all my texts are coming to both phones.. How do I get a secondary apple ID and change it on my business phone?

    I used my existing apple ID when I purchased a second iPhone for my business.. Now all my texts are coming to both phones.. Is there a way to create a new apple account for my business phone and if so.. How do I delete one and add another?

    Yes, you can have two separate Apple IDs, and it's pretty easy to set this up. Go into Settings > iTunes & App Store on your business phone. You should see your current Apple ID. Tap on it, then tap on sign out. You can then create a new Apple ID, using a different email address and password than those associated with the Apple ID on your other phone. Log back in using this new information, and you shouldn't get the texts that come to your other phone.
    Hope this helped!

Maybe you are looking for

  • IPad air safari not working in iOS 8.1

    I have an iPhone 5, 5S and ipad air all on version 8.1.  Safari is not working on any of them.  It tries to load, the blank safari screen comes up, then it crashes and goes back to home screen.  I have to use google chrome to access the internet. I t

  • Outlook 2007 sync errors with 4s IOS 7.1

    Syncing between Outlook 2007 (windows 7) and my iPhone 4s (IOS 7.1) - inconsistent results where some addresses do not sync, home addresses appear as work - no consistent pattern.  Uninstalled and reinstalled iTunes.  Cleared sync history.  Deleted c

  • Cannot Connect iPod to Itunes or Computer

    When i connect my ipod through the usb port, nothing comes up on itunes or my computer to say it is connected and i can begin synching my music. Any help?

  • Skipping on playback

    I've imported about 3 minutes of video into iMovie HD and arranged the clips how I want them. There's no blank clips in between, but both audio and video are skipping on playback. I thought it was just in iMovie, but when I burned it to iDVD, it does

  • I accidently deleted my recently added songs. How can I retrieve them?

    I accidently deleted my recently added songs on itunes. How can I retrieve them?