Skip to content
Advertisement

Tag: struts2

How does the validate() method in Struts 2 get the result “input”?

In Struts 2, “input” is returned when a check fails in the validate() method. I then map <result name=”input”> in struts.xml for the appropriate page. I am just wondering how it gets the “input”, which is a String when the validate() method itself returns void? I would like to understand this concept. Answer The validate() method itself returns nothing (void).

Content-Type not allowed: fileUpload in Struts 2

I am new to Struts 2 and trying to do use fileUpload interceptor. I am attaching all my code layers Action Class (FileUploadAction): error.jsp: Success.jsp: fileUpload.jsp: I am not understanding why I am getting this error Although my uploading file format is .jpg. Answer You are getting this error probably because you don’t allow files with content type image/pjpeg. Use

How to get exception inside ActionInvocation.invoke()

First of all the final purpose is that i’m trying to inject a DAO connection into an SMD context (Ajax) so i’ll ensure that transactions are being Commited (or Rollback), my problem is that i’m not being able to know if the invoke() method throws an exception, I have the following Interceptor: The line “attempt to solve” is based on

Add one more option field in the Struts2 select tag

i have one struts 2 select tag like below. it rendered as below i want to add one more option field with null value to the Option field with modification in the list. In struts 1 it is possible like below like that is it possible in the struts 2 note:i couldn’t able to modifiy the list before the page

Advertisement