Skip to content
Advertisement

Tag: jsp

JSP input comes null to servlet

I’m trying to pass parameter to jsp to servlet. And my code is : Server side : JSP side : When i run it on localhost kullanici variable comes null. Any solution ? EDİT : Answer I think you mean that you want to go FROM a jsp TO a servlet. If that’s the case, look the action attribute: If

if else statement not working jsp

Is there anything wrong with my code? My if else statement is not working. Answer You need to use the .equals method to test for string equality. Try this instead:

Storing integer as attribute in jsp

I want to pass an Integer value as an attribute in JSP. But when i try an error is returned. Could you tell me a method to store Integer numbers as attributes in JSP? I am getting a casting error saying parseInt() is not suited for handling objects. Answer request.getAttribute returns an Object. you need to cast this to String

Pass Hidden parameters using response.sendRedirect()

How would I pass hidden parameters? I want to call a page (test.jsp) but also pass 2 hidden parameters like a post. Answer TheNewIdiot’s answer successfully explains the problem and the reason why you can’t send attributes in request through a redirect. Possible solutions: Using forwarding. This will enable that request attributes could be passed to the view and you

NoSuchMethodError when using submitting form in Struts 2

I’m currently working through the tutorial found on the Apache Struts website. Currently, whenever I press submit on the form, or when I click the Bruce Philips hyperlink, I get a NoSuchMethodError. I’m not too sure what the issue is either and I believe I’ve included everything the tutorial states. I’ve tried including the dependency in my pom.xml, but that

Changing value of <c:set jstl tag

I am using the following expression on my jsp I have a condition inside a for each loop where I might want to change this variable to true. Is there a way to do this. I’ve looked everywhere but unable to find a solution. Answer Here is the sample code you are looking for:

How to access a request attribute set by a servlet in JSP?

I’m trying to retrieve attribute values set by a servlet in a JSP page, but I’ve only luck with parameters by ${param}. I’m not sure about what can I do different. Maybe its simple, but I couldn’t manage it yet. In the JSP I have been trying to retrieve the “attribValue”, but without success: If I pass a parameter through

Advertisement