my dog learned polymorphism*
The moose likes Applets and the fly likes how to call Jsp pages operation  through Applet button click Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "how to call Jsp pages operation  through Applet button click" Watch "how to call Jsp pages operation  through Applet button click" New topic
Author

how to call Jsp pages operation through Applet button click

sandeep bhatt
Greenhorn

Joined: Apr 14, 2012
Posts: 1
I am calling jsp page through applet .then jsp perform database process accurately but does not loaded on web browser.
i want to call jsp page through URL object inside the applet and its half working but jsp pages loaded on broswer


i am success to call jsp page but its not loaded on browser.how its loaded can any help me
please help me


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>


<body>
<h1>Hello World!</h1>
<h1>Hello World!</h1>
<h1>Hello World!</h1>
<h1>Hello World!</h1>
<h1>Hello World!</h1>

</body>
<%--
<%
String sno=request.getParameter("abc");
String l="";
String l1="insert into qustion_detail(codelength)values('"+sno+"')";

connect_me obj=new connect_me();
Connection con=obj.getConnection();
con.createStatement().execute(l1);
%>
--%>
</html>







<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
try {
String postData="";
String retval = "";


URL url = new URL("http://localhost/voice/call_page.jsp");

HttpURLConnection urlconnection = (HttpURLConnection) url.openConnection();
urlconnection.setDoOutput(true);

OutputStreamWriter out1 = new OutputStreamWriter(urlconnection.getOutputStream());
out1.close();
BufferedReader in = new BufferedReader( new InputStreamReader(urlconnection.getInputStream()));
String decodedString;

while ((decodedString = in.readLine()) != null) {
retval += decodedString;
}System.out.println(retval);
in.close();
//Desktop desktop = java.awt.Desktop.getDesktop();
//URI uri = url.toURI();
//desktop.browse(uri);=
%>
<div style="margin:200px 330px"><font style="color: black;font-weight: bold;font-family: arial;">Your message has been sent succesfully</font>
</div>
<%
}catch(Exception use){
throw new AssertionError(use);
}
%>
</body>
</html>
 
jQuery in Action, 2nd edition
 
subject: how to call Jsp pages operation through Applet button click
 
Similar Threads
EL in JSP is not interpreted at all
Inserting images on JSP page
servlet showing blank page.
No suitable driver problem
creating html file from jsp