Mercurial > dive4elements > gnv-client
diff gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java @ 963:0441e78cd900
Add more Javadocs
gnv/trunk@1107 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 18 May 2010 11:09:33 +0000 |
parents | f550bd27a3f1 |
children | 33198e55371c |
line wrap: on
line diff
--- a/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Tue May 18 10:52:12 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Tue May 18 11:09:33 2010 +0000 @@ -4,19 +4,29 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; /** + * Basicimplemantation for all Actions which should serv request for + * the GNV. * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ public class ArtifactDatabaseActionBase extends Action { + /** + * The id of the action which should used if the execution + * of the action was successful. + */ protected final static String SUCCSESS_FORWARD_ID = "success"; + + /** + * The id of the action which should be used if an exception has occurred + * during the execution. + */ protected final static String EXCEPTION_FORWARD_ID = "success"; /** @@ -32,25 +42,31 @@ super(); } - @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { log.debug("ArtifactDatabaseActionBase.execute"); - ActionForward forward = mapping.findForward(SUCCSESS_FORWARD_ID); return forward; } - + /** + * Returns the Action that should be used if an exception has occurred. + * @param mapping the mapping which holds all available Actions + * @return the Action that should be used. + */ protected ActionForward getExceptionForward(ActionMapping mapping) { log.debug("ArtifactDatabaseActionBase.getExceptionForward"); ActionForward lForward = mapping.findForward(EXCEPTION_FORWARD_ID); return lForward; } - + /** + * Encodes the <code>String</code> to prevent cross-site-scripting + * @param s the string that should be encoded + * @return the encoded string + */ protected String encode(String s) { log.debug("String to encode: " + s); s = s.replaceAll("<", "<"); @@ -62,7 +78,11 @@ return s; } - + /** + * Encodes the <code>StringArray</code> to prevent cross-site-scripting + * @param s the stringarray that should be encoded + * @return the encoded stringarray + */ protected String[] encode(String[] s) { if (s == null) return null;