File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to call Jsp pages operation through Applet button click

 
sandeep bhatt
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic