configuration des fichiers.xml
Salut a tous
Bien j'ai un grop pb sur mon application!
Ben voila je programme sous java et j'ai l'impression que mon fichier de configuration ne charge pas mon struts-config car mes actions ne son pas retrouvé
voici le contenu de mon struts-config:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
| <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<data-sources/>
<!-- Noms des ActionForm -->
<form-beans>
<!-- ActionForms de l'onglet "Sinistre" -->
<form-bean name="sinistreForm" type="com.eccgnet.gestionSinistre.struts.form.SinistreForm"/>
<!-- ActionForms de l'onglet "Facture" -->
<form-bean name="factureForm" type="com.eccgnet.gestionSinistre.struts.form.FactureForm"/>
</form-beans>
<!-- Mapping des Actions -->
<action-mappings >
<!-- Actions de l'onglet "Sinistre" -->
<action
path="/sinistreSearch"
scope="request"
name="sinistreForm"
type="org.springframework.web.struts.DelegatingActionProxy"
parameter="method">
<forward name="ok" path="/web/sinistre/sinistreList.jsp"/>
<forward name="ko" path="/web/sinistre/sinistre.jsp"/>
</action>
<!-- Actions pour Struts-Layout -->
<action path="/sort"
scope="request"
validate="false"
type="fr.improve.struts.taglib.layout.sort.SortAction">
</action>
</action-mappings>
<!-- Fichier de ressource des libelles -->
<message-resources key="org.apache.struts.action.MESSAGE" parameter="com.eccgnet.gestionSinistre.struts.ressources.ApplicationResource" null="false"/>
<!-- Fichier de ressource des messages d'erreur -->
<message-resources key="msg" parameter="com.eccgnet.gestionSinistre.struts.ressources.ApplicationResourceMessages" null="false"/>
<!-- Plug-in d'integration de Spring -->
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="
/WEB-INF/applicationContext.xml,
/WEB-INF/applicationContextDao.xml,
/WEB-INF/applicationContextManager.xml,
/WEB-INF/action-servlet.xml"/>
</plug-in>
<!-- Plug-in pour changer les proprietes de Skin de Struts-Layout -->
<plug-in className="fr.improve.struts.taglib.layout.workflow.LayoutPlugin">
<set-property property="skinResources" value="com.eccgnet.gestionSinistre.struts.ressources.StrutsLayoutPrerefSkin"/>
</plug-in>
<!-- Plug-in pour integrer le Validator Struts -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml
,/WEB-INF/validation.xml" />
<set-property property="stopOnFirstError" value="true" />
</plug-in>
</struts-config>
le contenu de mon action-servlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean name="/sinistreSearch" class="com.eccgnet.gestionSinistre.struts.action.sinistre.SinistreSearchAction" autowire="byName"/>
</beans>
le contenu de mon web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>com.eccgnet.gestionSinistre.struts.servlets.ServletBase</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>5</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>5</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>web/accueil/accueil.html</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-layout</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-layout.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/onglet</taglib-uri>
<taglib-location>/WEB-INF/tld/onglet.tld</taglib-location>
</taglib>
</web-app>
et maintenant j'appelle mon action dans mon fichier menu.jsp
<%@ taglib uri="/tags/onglet" prefix="onglet" %>
<%
String appName = request.getContextPath();
String onglet = request.getParameter("onglet");
String menu = request.getParameter("menu");
%>
<onglet:ongletsGroupe>
<onglet:ongletTitre libelle="Sinistres" currentOnglet="<%=onglet%>"
url="../sinistre/sinistres.jsp" griser="false"/>
</onglet:ongletsGroupe>
<onglet:menus>
<onglet:groupeMenu parametre="Sinistres" value="<%=onglet%>">
<onglet:menu libelle="Liste des sinistres" url="/sinistreSearch.do"
currentOnglet="<%=menu%>" parametre="" value=""/>
<onglet:menu libelle="Nouveau sinistre" url="../sinistre/sinistre.jsp"
currentOnglet="<%=menu%>" parametre="" value=""/>
</onglet:groupeMenu>
</onglet:menus> |
Mon problem c'est qu'il me donne une erreur 404 disant que : /sinistreSearch.do est introuvable !
En fait il ne reconnait pas l'action et en plus sur la console d'eclipse pas de message !
j'ai beau chercher ou se trouvait l'erreur helas, je crois que le probleme me depasse, je ne suis pas vraiment experte en J2EE
Merci de m'aider
configuration des fichiers.xml
Merci fnobb de me repondre si tot
Ben voila je vien juste d'essayer : http://localhost:8080/gestionSinistre/sinistreSearch.do et, bien qu'il existe toujours une erreur mais cette fois l'erreur à evolué car il arrive a entrer dans ma classe cela veut dire qu'il a vue l'action sinistreSearch.do
Mais le problème c'est que je dois acceder à cette action par le bien de la jsp à partir de la ligne :
<onglet:menu libelle="Liste des sinistres" url="/sinistreSearch.do"
currentOnglet="<%=menu%>" parametre="" value=""/>
et la ça ne marche tjr pas !
merci d'avance
configuration des fichiers.xml
Merci bcp pour ta solution fnnob
j'ai utilisé solution utilisant les scriplets classiques
Code:
<onglet:menu libelle="Liste des sinistres" url='<%=request.getContextPath()+"/sinistreSearch.do"%>' currentOnglet="<%=menu%>" parametre="" value=""/>
le message ci dessous apparais ,cela veut dire que pour ce probleme c'est resolu puisqu'il arrivé a entrer dans la classe
il ne me reste qu'à trouver la solution pour resudre ce second probleme c'est deja un gand pas pour moi car j'y suis resté depuis hier et je te remercie beaucoup pour ce pas vers l'avant!!
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| java.lang.NullPointerException
at com.eccgnet.gestionSinistre.struts.action.sinistre.SinistreSearchAction.execute(SinistreSearchAction.java:59)
at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at com.eccgnet.gestionSinistre.struts.servlets.ServletBase.doGet(ServletBase.java:32)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source) |
configuration des fichiers.xml
Supper ! fnobb
je l'ai verifié merci ,je vais donc essayer de comprendre pourquoi est ce que ma liste est nulle!!