#Warning Using jstl , I have no idea how to fix it .
77 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @rain bluff! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Menu</title>
</head>
<body>
<ul>
<c:forEach var="item" items="${foodItems}">
<li><c:out value="${item}"/></li>
</c:forEach>
</ul>
</body>
</html>```
this is the JSP File 👆
This is the Java File 👇
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
@SuppressWarnings("serial")
@WebServlet("/FoodCart")
public class FoodCart extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//get the data from the database(model)
String[] foodItems = {"Biryani","Pizza","Pasta","Butter_Chicken","Fried_Rice"};
request.setAttribute("foodItems", foodItems);
//redirect to a different page(view)
RequestDispatcher dispatcher = request.getRequestDispatcher("show-food.jsp");
dispatcher.forward(request,response);
}
}```
You are using Jakarta EE
but the JSP file is written for Java EE (see the taglib thing at the top)
Also make sure your web.xml is using Jakarta EE specs/schema
how do i use Java EE then ? I have not much experience using Eclipse IDE , sorry
right , makes sense now
Jakarta EE works, you just need different URLs in the JSP files
Java EE has been replaced by Jakarta EE
ohh okay
i'll show what error i get when i use Jakarta URI
so can i use this ? :
http://jakarta.ee/jstl/core
okay
I haven't done anything in my web.xml , but this is how it looks :
hm, that looks correct
I have been trying to search for a fix for this for over 8 hours now , but I am just exhausted at this point . I don't know what should i do 🥺
it's not even a big code , it's just a small tag , and i am stuck here
which of them?
"Other problems with TagExtraInfo class: ignore"
failure instantiating TagExtraInfo class
set that to ignore
How did you get to that window?
try right-clicking on the project and selecting properties
Does that also have JSP > Validation?
or click the configure project specific settings link there
Is there any other JSP option?
What shown in the JSP syntax thing here?
Also which Eclipse version are you using?
I am not sure how to check , can you help me ?
Help > About
ok that's what I wanted to see
if you delete the c:forEach and add it again, the error still appears, right?
ohh wait what is this now :
i deleted and re-typed it , now it dosen't show error
But there isn't output as well 😭
Is there a stack trace?
whats that ?
I will be switching off for now , i will come back online later , If you find any fix later , please let me know . Thank you for the help so far
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use/help ping.
Warning: abusing this will result in moderative actions taken against you.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use/help ping.
Warning: abusing this will result in moderative actions taken against you.
lots of text in the console when an exception occurs - in most cases, it's red text
something like
An uncaught exception occured in thread xyz: java.lang.NullPointerException
at com.example.SomeClass.someMethod (SomeClass.java:1337ö
...
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use/help ping.
Warning: abusing this will result in moderative actions taken against you.
ohh okay , i got the code working finally
i thank you for your help 🙂
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.