<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!