error on jsp ..in j2ee while creating webservice using sun server
hey i am a new commer to j2ee platform ..i am developing a web service to encryp data...i have sucessfully deployed the server and the client ...when i run the client the jsp page(encrypt.jsp) gets loaded... but when i pass the parameter(data to be encrypted) and click submit which takes me to (result.jsp) next page which produces the folowing error ........where am i going wrong plzz help me out ...plzz its very urgent
result.jsp...he code is a as follows
<%@import javax.xml.rpc.Stub;%>
<%@import java.math.BigInteger;%>
<%@import java.util.Random;%>
<%
static int bits = 128;
try{
Stub stub=(Stub)(new MyRSAService_Impl().getRSAintPort());
Stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,"http://localhost:8080/myrsawar/rsa");
Random random = new Random();
System.out.println("\n\nComputing public key (N,e) and private key (N,d):");
// Choose two large primes p and q, let N = pq, and let p1p1 = (p-1)(q-1).
System.out.print("Computing p ... ");
System.out.flush();
BigInteger p = new BigInteger(bits, 50, random);
System.out.println(p);
System.out.print("Computing q ... ");
System.out.flush();
BigInteger q = new BigInteger(bits, 50, random);
System.out.println(q);
BigInteger N = p.multiply(q);
System.out.println("N = pq is" + N);
BigInteger p1 = p.subtract(BigInteger.ONE);
BigInteger q1 = q.subtract(BigInteger.ONE);;
BigInteger p1q1 = p1.multiply(q1);
System.out.println("(p-1)(q-1) is" + p1q1);
System.out.println();
// Choose numbers e and d such that e is prime and ed = 1 mod N.
BigInteger e = new BigInteger("" + 0x10001);
System.out.println("Using e =" + e);
System.out.print("Computing d ... ");
BigInteger d = e.modInverse(p1q1);
System.out.println(d);
// Now, the public key is the pair (N,d) and the private key
// is the pair (N,e). Do some encryptions and decryptions.
// The user enters text that is encoded into an array of
// integers. (Use an array, not a single integer, since
// the algorithm can only deals with a certain number of
// characters at a time.) Then this array is decoded to
// give (if the algorithm is working) the original text.
String b ;
b = request.getParameter("nam");
String s = b.toString();
RSAint R =(RSAint) stub;
BigInteger[] cyphertext = R.encode(s,N,e);
System.out.println();
System.out.println("Encoded Text, computed with RSA:");
for (int i = 0; i < cyphertext.length; i++)
System.out.println("" + cyphertext);
String plaintext = R.decode(cyphertext,N,d);
System.out.println();
System.out.println("Decoded Text, computed with RSA:");
System.out.println("" + plaintext);
}
catch (Exception e)
{
System.out.println("caught Exception :"+ e);
}
System.out.println();
%>
<html>
<head><title>welcome to RSA algorithm</title>
</head>
<body>
Encryption and decryption algorithm...
Encrypted text
<%for (int i = 0; i < cyphertext.length; i++) %>
<%=cyphertext)%>
Decrypted text
<%=plaintext%>
</body>
</html>
the error it produced
HTTP Status 500 -
--
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /result.jsp(1,4) Invalid directive
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:43)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:414)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:95)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:511)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1544)
org.apache.jasper.compiler.Parser.parse(Parser.java:131)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:214)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:487)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:516)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
note The full stack trace of the root cause is available in the Sun-Java-System/Application-Server logs.
--
Sun-Java-System/Application-Server
:( what should i do ...? plzz help me out of this error!!!!!

