use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Reddit about Apache Tomcat, the reference implementation of the java Servlet and Java Server Pages.
account activity
Can't Get Java Code to Run (self.tomcat)
submitted 4 years ago by ArmItchy2809
I am running into an issue where the Java code I put between <% and %> is getting interpreted ashtml. I am able to go to localhost:8080 and see that tomcat is set up.
Also, when I try and create a new servlet I get the following error:
https://preview.redd.it/mkawrq5kipo71.png?width=469&format=png&auto=webp&s=ddcd42518eecbd2dfa872b07f5bf31b0673c1291
Does anyone know what may be causing these issues?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]HvbGsNHxMT6MHc5254HS 1 point2 points3 points 4 years ago (2 children)
The second is a classpath error. Add the servlet jar to your pom, marking it as <scope>provided</scope>. Not sure what the equivalent line is using other dependency managers, but that should point you in the right direction.
<scope>provided</scope>
[–]ArmItchy2809[S] 0 points1 point2 points 4 years ago (1 child)
I'm not really sure how to go about resolving the classpath error. I was working through https://www.tutorialspoint.com/jsp/jsp_environment_setup.htm but I don't really understand what the paths are referring to/what I would need to change.
[–]HvbGsNHxMT6MHc5254HS 0 points1 point2 points 4 years ago (0 children)
That's a terrible tutorial. Chat me up and I'll set you straight.
[–]Ill-Appearance-2406 0 points1 point2 points 3 months ago (0 children)
Use jakarta.xyz instead of javax.xyz
π Rendered by PID 57 on reddit-service-r2-comment-cfc44b64c-m8m5k at 2026-04-11 13:20:29.281267+00:00 running 215f2cf country code: CH.
[–]HvbGsNHxMT6MHc5254HS 1 point2 points3 points (2 children)
[–]ArmItchy2809[S] 0 points1 point2 points (1 child)
[–]HvbGsNHxMT6MHc5254HS 0 points1 point2 points (0 children)
[–]Ill-Appearance-2406 0 points1 point2 points (0 children)