|
Struts example source code file (DWRValidator.java)
The Struts DWRValidator.java source code/* * $Id: DWRValidator.java 803360 2009-08-12 03:59:51Z musachy $ * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.struts2.validators; import java.util.HashMap; import java.util.Map; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.dispatcher.ApplicationMap; import org.apache.struts2.dispatcher.Dispatcher; import org.apache.struts2.dispatcher.RequestMap; import org.apache.struts2.dispatcher.SessionMap; import org.apache.struts2.dispatcher.mapper.ActionMapper; import org.apache.struts2.dispatcher.mapper.ActionMapping; import uk.ltd.getahead.dwr.WebContextFactory; import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.ActionProxy; import com.opensymphony.xwork2.ActionProxyFactory; import com.opensymphony.xwork2.DefaultActionInvocation; import com.opensymphony.xwork2.ValidationAware; import com.opensymphony.xwork2.ValidationAwareSupport; import com.opensymphony.xwork2.config.Configuration; import com.opensymphony.xwork2.config.entities.ActionConfig; import com.opensymphony.xwork2.config.entities.PackageConfig; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; /** * <p/> * Use the dwr configuration as follows :- * * <pre> * <!-- START SNIPPET: dwrConfiguration --> * * <dwr> * <allow> * <create creator="new" javascript="validator" class="org.apache.struts2.validators.DWRValidator"/> * <convert converter="bean" match="com.opensymphony.xwork2.ValidationAwareSupport"/> * </allow> * </dwr> * * <!-- END SNIPPET: dwrConfiguration --> * </pre> */ public class DWRValidator { private static final Logger LOG = LoggerFactory.getLogger(DWRValidator.class); public ValidationAwareSupport doPost(String namespace, String actionName, Map params) throws Exception { HttpServletRequest req = WebContextFactory.get().getHttpServletRequest(); ServletContext servletContext = WebContextFactory.get().getServletContext(); HttpServletResponse res = WebContextFactory.get().getHttpServletResponse(); Map<String, Object> requestParams = new HashMap Other Struts examples (source code examples)Here is a short list of links related to this Struts DWRValidator.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.