Package com.opensymphony.xwork2.interceptor

Examples of com.opensymphony.xwork2.interceptor.ScopedModelDriven


        StringBuilder link = new StringBuilder();

        boolean changedScheme = false;

        // FIXME: temporary hack until class is made a properly injected bean
        Container cont = ActionContext.getContext().getContainer();
        int httpPort = Integer.parseInt(cont.getInstance(String.class, StrutsConstants.STRUTS_URL_HTTP_PORT));
        int httpsPort = Integer.parseInt(cont.getInstance(String.class, StrutsConstants.STRUTS_URL_HTTPS_PORT));

        // only append scheme if it is different to the current scheme *OR*
        // if we explicity want it to be appended by having forceAddSchemeHostAndPort = true
        if (forceAddSchemeHostAndPort) {
            String reqScheme = request.getScheme();
View Full Code Here


    @Override
    public String intercept(ActionInvocation invocation) throws Exception {
        Object action = invocation.getAction();

        if (action instanceof ScopedModelDriven) {
            ScopedModelDriven modelDriven = (ScopedModelDriven) action;
            Object model = modelDriven.getModel();
            if (model != null && model instanceof ActionForm) {
                Struts1Factory factory = new Struts1Factory(configuration);
                ActionMapping mapping = factory.createActionMapping(invocation.getProxy().getConfig());
                HttpServletRequest req = ServletActionContext.getRequest();
                ((ActionForm)model).reset(mapping, req);
View Full Code Here

        Object action = invocation.getAction();

       
        if ((action instanceof ScopedModelDriven) &&
            (!(action instanceof Struts1Action) || ((Struts1Action)action).isValidate())) {
            ScopedModelDriven modelDriven = (ScopedModelDriven) action;
            Object model = modelDriven.getModel();
            if (model != null) {
                HttpServletRequest req = ServletActionContext.getRequest();
                Struts1Factory strutsFactory = new Struts1Factory(configuration);
                ActionMapping mapping = strutsFactory.createActionMapping(invocation.getProxy().getConfig());
                ModuleConfig moduleConfig = strutsFactory.createModuleConfig(invocation.getProxy().getConfig().getPackageName());
                req.setAttribute(Globals.MODULE_KEY, moduleConfig);
                req.setAttribute(Globals.MESSAGES_KEY, new WrapperMessageResources((TextProvider)invocation.getAction()));
               
                mapping.setAttribute(modelDriven.getScopeKey());
               
                ActionForm form = (ActionForm) model;
                form.setServlet(new ActionServlet(){
                    public ServletContext getServletContext() {
                        return ServletActionContext.getServletContext();
View Full Code Here

        Object action = invocation.getAction();

       
        if ((action instanceof ScopedModelDriven) &&
            (!(action instanceof Struts1Action) || ((Struts1Action)action).isValidate())) {
            ScopedModelDriven modelDriven = (ScopedModelDriven) action;
            Object model = modelDriven.getModel();
            if (model != null) {
                HttpServletRequest req = ServletActionContext.getRequest();
                Struts1Factory strutsFactory = new Struts1Factory(Dispatcher.getInstance().getConfigurationManager().getConfiguration());
                ActionMapping mapping = strutsFactory.createActionMapping(invocation.getProxy().getConfig());
                ModuleConfig moduleConfig = strutsFactory.createModuleConfig(invocation.getProxy().getConfig().getPackageName());
                req.setAttribute(Globals.MODULE_KEY, moduleConfig);
                req.setAttribute(Globals.MESSAGES_KEY, new WrapperMessageResources((TextProvider)invocation.getAction()));
               
                mapping.setAttribute(modelDriven.getScopeKey());
               
                ActionForm form = (ActionForm) model;
                form.setServlet(new ActionServlet(){
                    public ServletContext getServletContext() {
                        return ServletActionContext.getServletContext();
View Full Code Here

    @Override
    public String intercept(ActionInvocation invocation) throws Exception {
        Object action = invocation.getAction();

        if (action instanceof ScopedModelDriven) {
            ScopedModelDriven modelDriven = (ScopedModelDriven) action;
            Object model = modelDriven.getModel();
            if (model != null && model instanceof ActionForm) {
                Struts1Factory factory = new Struts1Factory(Dispatcher.getInstance().getConfigurationManager().getConfiguration());
                ActionMapping mapping = factory.createActionMapping(invocation.getProxy().getConfig());
                HttpServletRequest req = ServletActionContext.getRequest();
                ((ActionForm)model).reset(mapping, req);
View Full Code Here

    @Override
    public String intercept(ActionInvocation invocation) throws Exception {
        Object action = invocation.getAction();

        if (action instanceof ScopedModelDriven) {
            ScopedModelDriven modelDriven = (ScopedModelDriven) action;
            Object model = modelDriven.getModel();
            if (model != null && model instanceof ActionForm) {
                Struts1Factory factory = new Struts1Factory(configuration);
                ActionMapping mapping = factory.createActionMapping(invocation.getProxy().getConfig());
                HttpServletRequest req = ServletActionContext.getRequest();
                ((ActionForm)model).reset(mapping, req);
View Full Code Here

        Object action = invocation.getAction();

       
        if ((action instanceof ScopedModelDriven) &&
            (!(action instanceof Struts1Action) || ((Struts1Action)action).isValidate())) {
            ScopedModelDriven modelDriven = (ScopedModelDriven) action;
            Object model = modelDriven.getModel();
            if (model != null) {
                HttpServletRequest req = ServletActionContext.getRequest();
                Struts1Factory strutsFactory = new Struts1Factory(configuration);
                ActionMapping mapping = strutsFactory.createActionMapping(invocation.getProxy().getConfig());
                ModuleConfig moduleConfig = strutsFactory.createModuleConfig(invocation.getProxy().getConfig().getPackageName());
                req.setAttribute(Globals.MODULE_KEY, moduleConfig);
                req.setAttribute(Globals.MESSAGES_KEY, new WrapperMessageResources((TextProvider)invocation.getAction()));
               
                mapping.setAttribute(modelDriven.getScopeKey());
               
                ActionForm form = (ActionForm) model;
                form.setServlet(new ActionServlet(){
                    public ServletContext getServletContext() {
                        return ServletActionContext.getServletContext();
View Full Code Here

    public <T> T getInstance(Class<T> type) {
      try {
        T obj = type.newInstance();
        if (obj instanceof ObjectFactory) {
          ((ObjectFactory) obj).setReflectionProvider(new OgnlReflectionProvider() {

            @Override
            public void setProperties(Map<String, String> properties, Object o) {
            }
View Full Code Here

    if (messageKey == null || StringUtils.isBlank(messageKey) && StringUtils.isNotBlank(defaultValue)) {
      message = StringUtils.capitalize(defaultValue);
    }
    // the titleKey attribute is used
    else {
      OgnlValueStack stack = (OgnlValueStack) TagUtils.getStack(pageContext);
     
      for (Object o : stack.getRoot()) {
        if (o instanceof TextProvider) {
          TextProvider tp = (TextProvider) o;
          message = tp.getText(messageKey, UNDEFINED_KEY + messageKey + UNDEFINED_KEY);
          break;
        }
View Full Code Here

   */
  @Override
  public Locale resolveLocale(HttpServletRequest request) {

    Locale result = null;
    OgnlValueStack stack = (OgnlValueStack) ActionContext.getContext().getValueStack();

    for (Object o : stack.getRoot()) {
      if (o instanceof LocaleProvider) {
        LocaleProvider lp = (LocaleProvider) o;
        result = lp.getLocale();
        break;
      }
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.interceptor.ScopedModelDriven

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.