Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1030041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:38:19+00:00 2026-05-16T12:38:19+00:00

<html> <body> <form action=Test1.jsp method=post> <select name=source onchange=> <option value=rss>RSS LINK</option> <option value=other>OTHER LINK</option>

  • 0
<html>
<body>
<form action="Test1.jsp" method="post">

<select name="source" onchange="">
<option value="rss">RSS LINK</option>
<option value="other">OTHER LINK</option>
</select>       

Enter URL to be added   <input type="text" name="url" size=50>

Enter the Source Name of the URL<t><input type="text" name="source1" size=50>

<input type="Submit" name="submit1" value="Add URL in DB">
</form>   
</body>
</html>

The above code is stored in Addurl1.jsp file which calls the other jsp file named Test1.jsp.
The code under Test1.jsp is as follows

<%@ page import="myfirst.*" %>
<%
 String url1=request.getParameter("url");
 String source1=request.getParameter("source1");
 myfirst.SearchLink p=new myfirst.SearchLink();
 String result=p.addURL(url1,source1);
 out.println(result);
 System.out.println(result);
%>

Test1.jsp calls addURL(String, String) function of SearchLink.java program.
In the dropdownbox of Addurl1.jsp program, if the user selects RSS link, the addURL() method must be called. If the user selects OTHER LINK, there is another method named addURL1() in the same java program which must be called.

Please let me know how the above codes can be modified inorder to achieve my task.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:38:20+00:00Added an answer on May 16, 2026 at 12:38 pm

    At first it is better to change Addurl1.jsp into a servlet and implement the doPost method. Jsp files are supposed to only contain the presentation layer and no Java code. Java code should go in servlets (or controllers if you are using an MVC framework).

    What you are asking can easily be achieved with an if statement:

    final String RSS_LINK = "rss";
    final String OTHER_LINK = "other";
    
    String url1=request.getParameter("source");
    String result="";
    if (url1 != null && url1.equals(RSS_LINK)) {
        result=p.addURL(url1,source1);
    }
    else if (url1 != null && url1.equals(OTHER_LINK)) {
        result=p.addURL1(url1,source1);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<html> <head> <title>ADD URL Sources</title> </head> <body> <form action=Test1.jsp method=post> <br><br><select name=source onchange=> <option
<html> <body> <form action=login.do method=post> //..... <input type=submit value =send> </form> </body> </html> In
I have a form <html> <head> </head> <body> <form> <select id=groups> <optgroup label=GroupA> <option
I want to pass php variable value as a action to html form. I
HTML <body> <form id=form1 runat=server> <asp:Button runat=server ID=a OnClick=a_Click Text=apd/> </form> </body> Code protected
$('a').click(function(event){ $('body').html('loading...'); $.post('www.sitename.com/hello',{site:http//:www.google.com},function(data) { alert(data); }); event.preventDefault(); }); I am using the above script
I am just starting with Servlets/JSP/JSTL and I have something like this: <html> <body>
how can i convert xpath like /html/body/div[3]/ul/li[1]/a[5] html > body > div[3] > ul
How do i add a new line characters to html body of mail composer?
The recursive setTimeout function getRandomProducts is called onload in the html body tag, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.