0

the action as specified below is not found

<form action="editEvaluation.do"  method="post"  >
 ****
</form>

the error is :

message Invalid path /situationAdministrative/evaluation/editEvaluation was requested

but where i write the url as this /GRH/editEvaluation.do , GRH is the name of my project it works fine

this the action mapping in my struts config :

 <action path="/editEvaluation" type="ma.struts.action.situationAdministrative.EditEvaluationAction" />

the url of my jsp is //localhost:8080/GRH/situationAdministrative/evaluation/evaluations.jsp

Roman C
  • 49,761
  • 33
  • 66
  • 176
fatiDev
  • 5,752
  • 7
  • 28
  • 45

1 Answers1

1
<html:form action="/editEvaluation">
    ...
</html:form>
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • this works , but form my case , i have a actionForm , only the action , so it won't work , – fatiDev Feb 01 '13 at 15:11
  • Err, what? I don't understand what you're saying. – JB Nizet Feb 01 '13 at 15:15
  • when i use the thag html:form , i got this error , Cannot retrieve definition for form bean null – fatiDev Feb 01 '13 at 15:19
  • 1
    Then write an ActionForm for this action, or use `
    `.
    – JB Nizet Feb 01 '13 at 15:26
  • what i want to know is why it not working whith the syntax i used , why it looks for the action , in the same sub-folder where is my jsp – fatiDev Feb 01 '13 at 15:31
  • 1
    Then why don't you ask that in your question? You specified a relative path (i.e. not starting with `/` or with `http://`). So the path is relative to the URL of the currently displayed page in the browser. If the address bar in your browser is at the path `/GRH/situationAdministrative/evaluation/something`, then it looks in the current "folder", i.e. at `/GRH/situationAdministrative/evaluation/editEvaluation.do`. Note that you should never have the URL of a JSP in the address bar. That means that you access a view directly, instead of going through a controller. – JB Nizet Feb 01 '13 at 15:35
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/23785/discussion-between-fatidev-and-jb-nizet) – fatiDev Feb 01 '13 at 15:38
  • 1
    @fatiDev Why do you have a Struts action, and a form, without an ActionForm? – Dave Newton Feb 01 '13 at 17:16
  • it's not a good practice i think but it's question of coding less , and really , even if it's what must be done , i'm not convinced – fatiDev Feb 01 '13 at 17:19
  • so the solution was to specify the attribute base , with the two lines bellow – fatiDev Feb 03 '13 at 20:05
  • String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; – fatiDev Feb 03 '13 at 20:06