Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Passing a variable from a jsp page to Java code and back to jsp page.

  1. #1
    Junior Member
    Join Date
    May 2023
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Passing a variable from a jsp page to Java code and back to jsp page.

    I am new to Java programming but I have some experience in programming.

    <display:column titleKey="testOrder.voucher" width="110">
    ${testOrder.voucherNumber}
    </display:column>


    ${testOrder.voucherNumber} prints a string made of a combination of letters and numbers (ABC1234).

    I want a way to split the string ABC1234 and only print the number 1234 in the input box.
    Also, I want the user to only be able to write numeric values in the input box.

    Thanks for the help.

  2. #2
    Member Helium c2's Avatar
    Join Date
    Nov 2023
    Location
    Kekaha, Kaua'i
    Posts
    102
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Passing a variable from a jsp page to Java code and back to jsp page.

    Just declare it. String x = " ";
    String y = " ";
    String z = " ";

    Then write it out. So the results being z. You would re-type the method or formula in to split ABC and 1234 to give the results as...this would then be in jsp. And they're using probably html to mark up a page. I know C++ is similar to Java. But the same approach. This would be the conversion part. Write it in the program in Java.

Similar Threads

  1. opening a new page and running a script on it, from the old page.
    By Hudsense in forum Other Programming Languages
    Replies: 1
    Last Post: September 25th, 2014, 04:44 AM
  2. opening a new page and running a script on it, from the old page.
    By Hudsense in forum What's Wrong With My Code?
    Replies: 0
    Last Post: September 25th, 2014, 03:51 AM
  3. Replies: 6
    Last Post: August 4th, 2014, 05:04 AM
  4. help taking code from java class put it in JSP page.
    By anavagomez in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 26th, 2012, 10:57 AM