Hi there - can anyone tell me why this will not compile? ====================================================== import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; import java.math.*;
//generates a prime of approx. 50 digits public class SimplePrimeTag extends TagSupport { protected int len = 50; public int doStartTag() { try { JspWriter out = pageContext.getOut(); BigInteger prime = Primes.nextPrime(Primes.random(len)); out.print(prime); } catch (IOException ioe) { System.out.println("Error generating prime: " + ioe); } return (SKIP_BODY); } } ============================================================ Error message reads: E:\Program Files\Apache Group\Tomcat2\webapps\examples\WEB-INF\classes\coreservlets\tags\SimplePrimeTag.java:20: cannot resolve symbol symbol : variable Primes location: class SimplePrimeTag BigInteger prime = Primes.nextPrime(Primes.random(len)); ^ E:\Program Files\Apache Group\Tomcat2\webapps\examples\WEB-INF\classes\coreservlets\tags\SimplePrimeTag.java:20: cannot resolve symbol symbol : variable Primes location: class SimplePrimeTag BigInteger prime = Primes.nextPrime(Primes.random(len)); ^ 2 errors ============================================================== I copied this straight from a Sun custom jsp tags tutorial. Thank you. Clive
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
It looks like it can't find the class Primes, so it thinks that it is a variable that you forgot to declare and instantiate.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Clive van Hilten
Greenhorn
Joined: Jul 26, 2001
Posts: 5
posted
0
Thanks Cindy. Where is the class Primes to be found? I would have thought it was covered by 'import java.math.*'?
Roy Tock
Ranch Hand
Joined: Jul 16, 2001
Posts: 83
posted
0
Being a mathematician, I'm VERY interested to see this Primes class. I'd even be more interested in seeing the source.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.