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: Jsp help

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Jsp help

    Can any one help me to solve this please

    <%@page import="myutil.*" %>
    <%String input = request.getParameter("s1");%>
    <%String occur = request.getParameter("s2");%>

    <%int output=B.repeatCount("input","occur");%>

    <%=input%>

    In the above code , i want to pass the variable of Strings input and occur to the method repeatCount.. can any one suggest how to do it
    for example if i get input = abc and occur =qwe
    i want to get in the generated servlet as follows:
    int output=B.repeatCount("abc","qwe");


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,372
    Thanks
    184
    Thanked 836 Times in 779 Posts
    Blog Entries
    5

    Default Re: Jsp help

    Simple pass the variable to the function
    <%
    String arg1 = request.getParameter("myParameter");
    int output = B.repeatCount(arg1);
    %>

    If you have not yet, I'd suggest reading through the Java Tutorials

  3. The Following User Says Thank You to copeg For This Useful Post:

    hussain4hunt (January 6th, 2011)

Tags for this Thread