Bonjour à tous,
Avec struts1, est-il possible de créer ou de modifier dynamiquement, c'est-à-dire après chargement, des forms (FormBeanConfig), ou sinon comment recharger dynamiquement la configuration struts ?
Merci,
Cordialement,
EJL - TOulouse
Bonjour à tous,
Avec struts1, est-il possible de créer ou de modifier dynamiquement, c'est-à-dire après chargement, des forms (FormBeanConfig), ou sinon comment recharger dynamiquement la configuration struts ?
Merci,
Cordialement,
EJL - TOulouse
Tu as entre autre la classe org.apache.struts.action.ActionMapping qui te permet de faire quelques modif du struts-config en théorie.
Je dis en théorie parce que quand j'ai essayé de changer l'attribut input dynamiquement j'ai eu le droit à une belle exception : Configuration is frozen
Et comme explication :
http://www.jguru.com/forums/view.jsp?EID=1248785i believe you are trying to dynamically add to the action configuration AFTER the configuration have been frozen during the application start up. i am not sure that there is a way around this.
to me, you may be doing something that you shouldn't be doing. if you are trying to add a forward dynamically because you have dynamic jsp's based on an action's outcome, perhaps you can have 1 pre-defined forward and set a dynamic attribute that can be used to do a jsp:include.
Dans l'Action, tu peux très bien définir un nouveau forward dynamiquement à partir du forward défini dans le mapping en y ajoutant par exemple un paramètre :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 ActionForward actionForward = mapping.findForward("success") ; return new ActionForward(actionForward.getPath()+"?id="+id,actionForward.getRedirect()) ;
Partager