How do i bring in the attributes from Servlet to JSP using JSTL ?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I am using Jakaratee with jstl but really i have forgotten how to do it.
Basically, I have use the HTTPServletRequest in my Controller to set attributes in order to bring it in to the jsp layer but i tried the entire morning, I can't make the attributes in.
Here's is a the code snippet to give you a clearer idea :
but in my jstl page, I am not able to bring the setAttributes that i want to display. I have put the jstl.jar onto the lib folder in the WEB-INF lib folder.
Hope I can get some answers here. Tks again
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I'll refrain from commenting on the JSP XML syntax, which has been out of fashion for many years.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:Were you hoping that "{exlir." would print the attribute? That's wrong in several ways; try "${exlir}" instead.
I'll refrain from commenting on the JSP XML syntax, which has been out of fashion for many years.
I managed to get the template fixed after searching for many hours but it is the web.xml that I am not sure now.
so i am not sure if the servlet-name should e restPostMan which is the context name or do i put /demo ?
and the jsp is
and the error i am getting is
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/restPostMan]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:878)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:846)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:241)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:428)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:912)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/restPostMan]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871)
... 21 more
Caused by: java.lang.NoClassDefFoundError: retrofit2/Converter$Factory
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
i have included the retrofit2 in Tomcat lib just to see if that is the caused, as suggested by SO but it is not helpful.
Hope I can get some answers here. Tks.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Mappings never contain the context name.
Also note that "restPostMan" is the name of the servlet, not "restController" (which the form action uses).
We don't know what you have in WEB-INF/lib and TOMCAT_HOME/lib, but apparently not the class retrofit2.Converter. So you need to add whatever jar file contains that. Build tools like Maven and Gradle can handle dependency management for you.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:"<servlet-class>package controller.restController</servlet-class>" is wrong; remove the "package" part. Also note that class names should start with an uppercase letter.
Mappings never contain the context name.
Also note that "restPostMan" is the name of the servlet, not "restController" (which the form action uses).
We don't know what you have in WEB-INF/lib and TOMCAT_HOME/lib, but apparently not the class retrofit2.Converter. So you need to add whatever jar file contains that. Build tools like Maven and Gradle can handle dependency management for you.
I already have it in my pom. Now I added into TOMCAT_HOME/lib again as well as the WEB-INF/lib, it is still giving me the same error.
I am not sure what is wrong. Attached i the tomcat configuration, do let me know if something is amissed. tks.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
tangara goh wrote:I already have it in my pom. Now I added into TOMCAT_HOME/lib again as well as the WEB-INF/lib, it is still giving me the same error.
It should be added to one of those directories, not both. Apparently you do not have it in your POM, or incorrectly so.
How have you ascertained that you do in fact have that class in a jar file in one of those directories? Tell us how you checked which jar file that class in is, and show us how that jar file is in one of those directories.
Seeing that you seem to run Tomcat inside of an IDE, I can easily picture the jar file not ending up in the correct runtime directory.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:
tangara goh wrote:I already have it in my pom. Now I added into TOMCAT_HOME/lib again as well as the WEB-
Tell us how you checked which jar file that class in is, and show us how that jar file is in one of those directories.
Seeing that you seem to run Tomcat inside of an IDE, I can easily picture the jar file not ending up in the correct runtime directory.
Please see attached.
And snippet of my pom
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.retrofit2/retrofit -->
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tell us how you checked which jar file that class in is, and show us how that jar file is in one of those directories.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:That screenshot, rather pointedly, does NOT contain the jar file in which the class retrofit2.Converter lives. I'll ask again:
Tell us how you checked which jar file that class in is, and show us how that jar file is in one of those directories.
the name is converter-gson which is from retrofit2
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>2.9.0</version>
</dependency>
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tell us how you checked which jar file that class is in
Because the converter-gson jar file does NOT contain the missing class.
If you want help you need to pay attention to what people are telling you.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:I'll ask yet again, hoping that you will actually do it this time:
Tell us how you checked which jar file that class is in
Because the converter-gson jar file does NOT contain the missing class.
If you want help you need to pay attention to what people are telling you.
ok. i think i know what you meant.
and i proceeded to add the respective files - retrofit files including okhttp3 etc
btw, it's never ending with the latest java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics but thank you so much and sorry I did not understand what you meant tks so much to make me wake up and read your message carefully.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I have no way of knowing whether some file on your disk is broken or incomplete. What I do know is that the "converter-gson" dependency simply does not contain the class retrofit2.Converter. That is why I keep asking how you have made sure that it does. Because it doesn't, and it baffles me how you might have gotten that idea.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
It would also help if you'd pretty-print (indent) your XML. Kind of hard to read there.
Basically, the process you're describing goes like this:
1. User submits a URL request. Tomcat has a map of URL patterns which it builds from servlet annotations (if present) and the /WEB-INF/web.xml WAR file (if present. web.xml overrides annotations, by the way.
2. Using the URL pattern map, Tomcat determines which servlet in the WAR to route the URL request to. If using web.xml, there's an abstraction where the pattern maps to a logical servlet name, which is then mapped to a servlet class.
3. The servlet does its thing and puts stuff it wants to display in JEE-scoped (request, session or application) named objects. It then forwards to the display JSP.
4. The display JSP (which internally gets compiled into a servlet itself) generates the output using the tags (including JSTL) and other dynamic properties such as Uniform Expression Laguage (UEL) expressions. The output then gets sent back to the requester for display.
If you're going to display a table, defining the table row in a c:forEach JSTL element is usually the way to go. Referenced to variable values are commonly done in UEL which defines a syntax that allows naming individual properties and sub-properties, including Map lookups and array indexed elements and is more detail that the current reply warrants. You use UEL, or simply named, "EL", to indicate escapting normal verbatim text copying, so for JSTL tags. you may see a variable named directly instead of via the EL "${name}" syntax. There's also a "#{name}" EL syntax, but it's used mostly by JavaServer Faces, as it designates a read/write reference, not a read-only reference.
As an example of more complex EL, the expression "${foo.bar}" means that EL will search the scopes for an object named "foo" and invoke its "getBar()" method to retrieve that property value. "${foo.bazz[5].id}" would expect that the getBazz() method on foo would return an iterable object such an array or list, look up the object on the 6th (offset from 0!) row, and invoke that object's "getID()" method.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:You shouldn't download anything from the Maven site, you should let Maven do this. That is what dependency management systems are for.
I have no way of knowing whether some file on your disk is broken or incomplete. What I do know is that the "converter-gson" dependency simply does not contain the class retrofit2.Converter. That is why I keep asking how you have made sure that it does. Because it doesn't, and it baffles me how you might have gotten that idea.
yes. so i am really puzzled why with maven - and i updated it, cleaned and installed it so many times, why would i still need to install the jars manually ?
here is the relevant dependencies
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
and i updated it, cleaned and installed it so many times
Why would you uninstall it? It's working, isn't it? You really need to focus less on your tools, and more on getting stuff done.
why would i still need to install the jars manually ?
You don't, as I keep telling you. Of course, currently your Maven POM does nothing with those dependencies. You need to add something about Maven creating a war file. See https://www.baeldung.com/maven-generate-war-file for an introduction; section 3 contains the first step.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
why would i still need to install the jars manually ?
You don't, as I keep telling you. Of course, currently your Maven POM does nothing with those dependencies. You need to add something about Maven creating a war file. See https://www.baeldung.com/maven-generate-war-file for an introduction; section 3 contains the first step.
I have rewritten based on your hints. Tks.
Here's the new pom but I am stuck at the output it to Tomcat directory which is in that frustrating Windows 0S that gives me a access denial. So, not to waste time, I chose to output it to a User directory and then added in a embedded tomcat.
But, when i run the server, this is the part that gets communicated, as it seem Eclipse will somehow call a Tomcat server which is not the embedded one.
How can I best navigate all these obstacles that is blocking my progress to the jsp which I have yet to figure out things?
so, basically, i got to learn the way from https://www.youtube.com/watch?v=xsfRSrDgBWI
and now the error is :
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:878)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:846)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:241)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:428)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:912)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871)
... 21 more
Caused by: java.lang.NoClassDefFoundError: jakarta/servlet/jsp/JspFactory
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:235)
at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:206)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1834)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1299)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:987)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:304)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4797)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 27 more
and it is quite strange that i already have jakarta.servlet.jsp.jstl it is still complaing i need jakarta/servlet/jsp/JspFactory
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
and it is quite strange that i already have jakarta.servlet.jsp.jstl it is still complaing i need jakarta/servlet/jsp/JspFactory
That sentence does not make sense. JSP and JSTL are different things. JSP is built into a servlet container, whereas JSTL needs to be added.
There seems to be a disconnect between the libraries you compile against, and the libraries (meaning, the Tomcat version) that you run the code on. I advise not to use the IDE for this, but to use a standalone Tomcat for running your code. That way you will know exactly what version of the libraries is used.
Let's take a look: "org.apache.tomcat.embed" - you almost certainly don't need this, as it doesn't sound like you're embedding a Tomcat.
"javax.servlet.jsp" - this is so old that's not even funny that it would be included in a current web app. But more importantly, it's the wrong version. It uses the javax.servlet namespace, whereas Tomcat 10.1.6 uses jakarta.servlet. For Tomcat 10.1, you need to use https://mvnrepository.com/artifact/jakarta.servlet/jakarta.servlet-api/6.0.0
What is causing this particular issue is likely the "jstl-1.2.jar" you have in TOMCAT_HOME/lib. That, too, is horribly outdated, and what's more, based on javax.servlet. The POM states that the container provides 3.0.1 of jakarta.servlet.jsp.jstl, so that's what you need to install. The relevant files are https://repo1.maven.org/maven2/jakarta/servlet/jsp/jstl/jakarta.servlet.jsp.jstl-api/3.0.0/jakarta.servlet.jsp.jstl-api-3.0.0.jar and https://repo1.maven.org/maven2/org/glassfish/web/jakarta.servlet.jsp.jstl/3.0.1/jakarta.servlet.jsp.jstl-3.0.1.jar
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:
and it is quite strange that i already have jakarta.servlet.jsp.jstl it is still complaing i need jakarta/servlet/jsp/JspFactory
That sentence does not make sense. JSP and JSTL are different things. JSP is built into a servlet container, whereas JSTL needs to be added.
There seems to be a disconnect between the libraries you compile against, and the libraries (meaning, the Tomcat version) that you run the code on. I advise not to use the IDE for this, but to use a standalone Tomcat for running your code. That way you will know exactly what version of the libraries is used.
Hi Ulf, I have put in all the lib that you mentioned. Now, when I run the server on standalone, it gives me the same error, even though the index page could be displayed.
Please find attached.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Now, when I run the server on standalone,
You're running Tomcat in an IDE - that is not "standalone".
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:The error message does indicate that not all jar files are where they should be, or that some jar files are the wrong versions. If you post the contents of TOMCAT_HOME/lib and WEB-INF/lib, maybe we can help you.
And, again, DO NOT put application JAR files into TOMCAT_HOME/lib. That includes application library JARs!!!
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Holloway wrote:
Ulf Dittmer wrote:The error message does indicate that not all jar files are where they should be, or that some jar files are the wrong versions. If you post the contents of TOMCAT_HOME/lib and WEB-INF/lib, maybe we can help you.
And, again, DO NOT put application JAR files into TOMCAT_HOME/lib. That includes application library JARs!!!
The content of Tomcat Lib is quite huge. Is it possible to attached a compressed file here?
I tried to attempt the stand alone Tomcat and I can't find any tutorial that can guide me how to operate a Tomcat server without IDE.
Can I have some guidance how I can test things out in Tomcat.
I got a reply from SO that I just dropped the entire Jakarata EE lib onto Tomcat and the error it will help. It did work but still I got to iron out all the dependencies as I need it for CICD.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
tangara goh wrote:The content of Tomcat Lib is quite huge. Is it possible to attached a compressed file here?
What we would need to see is not the files, but the list of files - in text, NOT as a screenshot.
I tried to attempt the stand alone Tomcat and I can't find any tutorial that can guide me how to operate a Tomcat server without IDE.
Start here: https://tomcat.apache.org/tomcat-10.1-doc/setup.html
I got a reply from SO
Oh, you are also asking this elsewhere, without mentioning this here? And probably without mentioning it there? Thus duplicating effort and wasting people's time? You've been here long enough to know that that's unfriendly behaviour. I just lost interest in helping you. Good bye.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:
tangara goh wrote:The content of Tomcat Lib is quite huge. Is it possible to attached a compressed file here?
What we would need to see is not the files, but the list of files - in text, NOT as a screenshot.
I tried to attempt the stand alone Tomcat and I can't find any tutorial that can guide me how to operate a Tomcat server without IDE.
Start here: https://tomcat.apache.org/tomcat-10.1-doc/setup.html
I got a reply from SO
Oh, you are also asking this elsewhere, without mentioning this here? And probably without mentioning it there? Thus duplicating effort and wasting people's time? You've been here long enough to know that that's unfriendly behaviour. I just lost interest in helping you. Good bye.
Er I need an answer fast so I do hope you understand that I am running out of money i need to complete this assignment.
but, today i found out that solution doesn't work.
Managed to copy it to txt :
01/03/2023 11:34 pm <DIR> .
01/03/2023 11:34 pm <DIR> ..
01/03/2023 12:06 am 14,122 annotations-api.jar
01/03/2023 12:06 am 55,980 catalina-ant.jar
01/03/2023 12:06 am 125,174 catalina-ha.jar
01/03/2023 12:06 am 63,435 catalina-ssi.jar
01/03/2023 12:06 am 78,936 catalina-storeconfig.jar
01/03/2023 12:06 am 324,727 catalina-tribes.jar
01/03/2023 12:06 am 1,702,785 catalina.jar
28/02/2023 09:21 pm 4,618 converter-gson-2.9.0.jar
01/03/2023 12:06 am 3,237,597 ecj-4.26.jar
01/03/2023 12:06 am 89,303 el-api.jar
01/03/2023 11:34 pm 71,370 jakarta.servlet.jsp-api-3.1.1.jar
01/03/2023 05:41 pm 3,711,043 jakarta.servlet.jsp.jstl-3.0.1.jar
01/03/2023 05:40 pm 46,041 jakarta.servlet.jsp.jstl-api-3.0.0.jar
01/03/2023 12:06 am 763,944 jakartaee-migration-1.0.6-shaded.jar
01/03/2023 12:06 am 172,849 jasper-el.jar
01/03/2023 12:06 am 569,478 jasper.jar
01/03/2023 12:06 am 28,466 jaspic-api.jar
01/03/2023 12:06 am 365,683 servlet-api.jar
01/03/2023 12:06 am 11,568 tomcat-api.jar
01/03/2023 12:06 am 870,285 tomcat-coyote.jar
01/03/2023 12:06 am 335,540 tomcat-dbcp.jar
01/03/2023 12:06 am 68,468 tomcat-i18n-cs.jar
01/03/2023 12:06 am 77,387 tomcat-i18n-de.jar
01/03/2023 12:06 am 104,046 tomcat-i18n-es.jar
01/03/2023 12:06 am 168,730 tomcat-i18n-fr.jar
01/03/2023 12:06 am 191,578 tomcat-i18n-ja.jar
01/03/2023 12:06 am 192,783 tomcat-i18n-ko.jar
01/03/2023 12:06 am 52,068 tomcat-i18n-pt-BR.jar
01/03/2023 12:06 am 49,200 tomcat-i18n-ru.jar
01/03/2023 12:06 am 175,966 tomcat-i18n-zh-CN.jar
01/03/2023 12:06 am 149,512 tomcat-jdbc.jar
01/03/2023 12:06 am 16,118 tomcat-jni.jar
01/03/2023 12:06 am 229,256 tomcat-util-scan.jar
01/03/2023 12:06 am 204,082 tomcat-util.jar
01/03/2023 12:06 am 240,150 tomcat-websocket.jar
01/03/2023 12:06 am 14,748 websocket-api.jar
01/03/2023 12:06 am 31,697 websocket-client-api.jar
37 File(s) 14,608,733 bytes
2 Dir(s) 15,923,810,304 bytes free
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Er I need an answer fast so I do hope you understand
I do understand your predicament, but I have no sympathy for you not mentioning it. You have been here long enough to have been reminded of this several times, yet you chose to ignore that once again. See https://coderanch.com/wiki/660346/Forthright-Cross-Posting-Sites for more information on that. So, as part of your next post, include links to all the places where you asked about this as well, so that we don't duplicate any more effort.
OK, that looks like a pretty clean Tomcat, except for converter-gson-2.9.0.jar. That's part of your web app, and belongs into WEB-INF/lib, together with the other dependencies (like Retrofit).
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:OK, that looks like a pretty clean Tomcat, except for converter-gson-2.9.0.jar. That's part of your web app, and belongs into WEB-INF/lib, together with the other dependencies (like Retrofit).
Actually, jakarta.servlet.jsp-api-3.1.1.jar looks suspicious. Wasn't there a jsp-api.jar file initially? Mucking around with Tomcat's internal files is a recipe for desaster.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:Actually, jakarta.servlet.jsp-api-3.1.1.jar looks suspicious. Wasn't there a jsp-api.jar file initially? Mucking around with Tomcat's internal files is a recipe for desaster.
I'm only speculating here, but it's very likely that the names of these files changed with Tomcat 10, since Tomcat 10 moved from Java EE to Jakarta EE.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:
Ulf Dittmer wrote:OK, that looks like a pretty clean Tomcat, except for converter-gson-2.9.0.jar. That's part of your web app, and belongs into WEB-INF/lib, together with the other dependencies (like Retrofit).
Actually, jakarta.servlet.jsp-api-3.1.1.jar looks suspicious. Wasn't there a jsp-api.jar file initially? Mucking around with Tomcat's internal files is a recipe for desaster.
Should I remove that jar ?
now, I tried out using jetty with eclipse and then it gives me error like this :
|java.lang.RuntimeException: Error scanning entry org/apache/taglibs/standard/tlv/JstlSqlTLV$Handler.class from jar file:///C:/Users/abc/xxx/abc-workSpace/restPostMan/src/main/webapp/WEB-INF/lib/jakarta.servlet.jsp.jstl-3.0.1.jar
the jar is also attached.
But, if i removed all the jars and the dependencies that Jetty is complaining, now it says it can't find my Controller.class.
I read that Eclipse inherited the Jakaratee EE, so it could be part of Eclipse, will the dependencies means redundant jars and so they are not supposed to be in ? What about Jetty since this is a Eclipse-jetty plug in I am using. ?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Stephan van Hulst wrote:I'm only speculating here, but it's very likely that the names of these files changed with Tomcat 10, since Tomcat 10 moved from Java EE to Jakarta EE.
Wait no, never mind. I see that that file was added or changed after the installation of Tomcat.
Tangara Goh, you really should not be changing ANY of the files in your Tomcat installation unless you understand exactly what you're doing and why you're doing it. Simply adding libraries to Tomcat just because your application is complaining about it is a BAD idea.
It's probably best that you get rid of your Tomcat installation and start fresh. When you've done this, you can probably solve your problem by removing <scope>provided</scope> from the JSTL dependency in your POM, as this scope is only used when the dependency is provided by your application server. Tomcat does NOT provide this dependency, so the provided scope is wrong.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Stephan van Hulst wrote:
Tangara Goh, you really should not be changing ANY of the files in your Tomcat installation unless you understand exactly what you're doing and why you're doing it. Simply adding libraries to Tomcat just because your application is complaining about it is a BAD idea.
What I tell you three times is True.
Almost none of the JAR files in TOMCAT_HOME/lib have version numbers in their names. That's because the only valid version is the one that came with Tomcat. Mess with them at your extreme peril.
To run Tomcat stand-alone:
1. Download the appropriate Tomcat ZIP file from tomcat.apache.org.
2. UNZIP it into a suitable directory. This can be your home directory for testing purposes.
3. Deploy your webapp into Tomcat. Generally you'd copy a WAR into TOMCAT_HOME/webapps.
4. CD into the root directory of the unzipped Tomcat. That's your TOMCAT_HOME. Start Tomcat from the command line. For Windows: For Linux/Unix/MacOS:
You can also install via Windows MSI, which allows you to run Tomcat as a Windows Service, but I don't recommend doing that until you understand how Tomcat works.
For debugging, point your IDE at the copy of Tomcat you just installed (TOMCAT_HOME).
Note that "TOMCAT_HOME" is our generic name for the root of Tomcat. Its actual name would be something like apache-tomcat-7.0.41 to use an outdated example.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
| Catch Ernie! Catch the egg! And catch this tiny ad too: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |







