Bonjour,
j'essaie avec le treeview mais ça marche pas chez moi
mon fichier config.xml:
mon fichier action:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 <?xml version="1.0" encoding="UTF-8"?> <!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 /> <form-beans /> <global-exceptions /> <global-forwards /> <plug-in className="fr.improve.struts.taglib.layout.workflow.LayoutPlugin"/> <action-mappings> <action path="/treeview" type="com.yourcompany.action.TestTreeviewAction"> <forward name="success" path="/index.jsp"/> </action> </action-mappings> <message-resources parameter="MessageResource" /> </struts-config>
mon index:index.jsp
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 package com.yourcompany.struts; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import fr.improve.struts.taglib.layout.menu.MenuComponent; import fr.improve.struts.taglib.layout.util.LayoutUtils; public class actionTreeView extends Action { public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception { MenuComponent lc_menu1 = new MenuComponent(); lc_menu1.setName("java"); MenuComponent lc_menu11 = new MenuComponent(); lc_menu11.setTitle("Java"); MenuComponent lc_menu111 = new MenuComponent(); lc_menu111.setTitle("Sun"); lc_menu111.setLocation("http://java.sun.com"); lc_menu11.addMenuComponent(lc_menu111); MenuComponent lc_menu112 = new MenuComponent(); lc_menu112.setTitle("Eclipse"); lc_menu112.setLocation("http://www.eclipse.org"); lc_menu11.addMenuComponent(lc_menu112); lc_menu1.addMenuComponent(lc_menu11); LayoutUtils.addMenuIntoSession(request,lc_menu1); return mapping.findForward("success") ; } }
déja il me signale une erreur que la ressource demandé n'est pas disponible pourtant tout est bien fait.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 <%@ taglib uri="/WEB-INF/struts-layout.tld" prefix="layout" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %> <html> <head> <layout:skin includeScript="true"/> <script src="/config/javascript.js"></script> </head> <body> <layout:form action="treeview" styleClass="FORM"> <layout:treeview name="java"/> </layout:form> </body></html>
Déja j'aimerais faire marcher le treeview et je sais pas si ca va marcher avec le code que j'ai fait
Partager