Package com.opensymphony.xwork2.util

Examples of com.opensymphony.xwork2.util.PropertiesReader


  private UserVO vo;
 
  public String execute(){
    String result = "";
    int sabun = 0;   
    ActionContext context = ActionContext.getContext();
    Map<String, UserVO> userMap = context.getSession();
    vo = userMap.get("user");
    try {
      sabun = vo.getSabun();
    } catch (NullPointerException e) {
      sabun = 0;
View Full Code Here


    }   
    return result;   
  }
 
  public int getSessionSabun(){
    ActionContext context = ActionContext.getContext();
    Map<String, UserVO> userMap = context.getSession();
    UserVO vo = userMap.get("user");
    int sabun = vo.getSabun();
    return sabun;
  }
View Full Code Here

      // 직급 테이블로부터 얻어온 보안등급 초기값 설정     
      uVO.setSlevel(orgDAO.getSlevel(uVO.getJobno()));
      // 실제 업데이트 수행
      userDAO.updateUser(uVO);
      // 수정된 vo객체를 세션에 저장
      ActionContext context = ActionContext.getContext();
      Map<String, UserVO> session = (Map<String, UserVO>)context.getSession();
      uVO = userDAO.getUserInfo(uVO.getSabun());
      session.put("user", uVO);       
      context.setSession(session);     
      result = "success";
    } catch (Exception e) {
      System.out.println("UserInputAction.updateUser():"+e.toString());     
      result = "error";
    }
View Full Code Here

import com.opensymphony.xwork2.ActionContext;
public class UserLogoutAction {
  public String execute(){
    try {
      // 세션에 저장된 유저정보를 삭제한다
      ActionContext context = ActionContext.getContext();
      Map<String, UserVO> session = context.getSession();     
      session.remove("user");
      context.setSession(session);     
    } catch (Exception e) {
      System.out.println("UserLogoutAction.execute():"+e.toString());
    }
    return "success";
  }
View Full Code Here

  }
 
  public String getUserInfo(){
    String result = "";
    try {     
      ActionContext context = ActionContext.getContext();
      vo = (UserVO) context.getSession().get("user");
      vo = userDAO.getUserInfo(vo.getSabun());
      jlist = orgDAO.getJobList();
      dlist = orgDAO.getDeptList();
      result = "success";
    } catch (Exception e) {
View Full Code Here

  public String intercept(ActionInvocation invoc) throws Exception {
    String result = "";
    try {
      jlist = orgDAO.getJobList();
      dlist = orgDAO.getDeptList();     
      ActionContext ac = ActionContext.getContext();
      Map<String, List> orgMap = ac.getParameters();
      orgMap.put("jlist", jlist);
      orgMap.put("dlist", dlist);
     
      result = "success";
    } catch (Exception e) {
View Full Code Here

        assertNotNull(result);
        assertTrue(result instanceof ServletRedirectResult);

        Mock invMock = new Mock(ActionInvocation.class);
        ActionInvocation inv = (ActionInvocation) invMock.proxy();
        ActionContext ctx = ActionContext.getContext();
        ctx.put(ServletActionContext.HTTP_REQUEST, request);
        StrutsMockHttpServletResponse response = new StrutsMockHttpServletResponse();
        ctx.put(ServletActionContext.HTTP_RESPONSE, response);
        invMock.expectAndReturn("getInvocationContext", ctx);
        invMock.expectAndReturn("getStack", ctx.getValueStack());
        result.execute(inv);
        assertEquals("http://www.google.com", response.getRedirectURL());
        //TODO: need to test location but there's noaccess to the property/method, unless we use reflection
    }
View Full Code Here

    }

    protected String lookupExtension(String extension) {
        if (extension == null) {
            // Look for the current extension, if available
            ActionContext context = ActionContext.getContext();
            if (context != null) {
                ActionMapping orig = (ActionMapping) context.get(ServletActionContext.ACTION_MAPPING);
                if (orig != null) {
                    extension = orig.getExtension();
                }
            }
            if (extension == null) {
View Full Code Here

   
    // ------- Action Bean storage -------

    private ActionProxy getActionProxy(ActionContext context)
    {
        ActionInvocation invocation = context.getActionInvocation();
        if (invocation==null)
        {
            log.error("Action Invocation cannot be obtained. Calling from action constructor?");
            return null;
        }
        ActionProxy proxy = invocation.getProxy();
        if (proxy==null)
        {
            log.error("ActionProxy cannot be obtained. Calling from action constructor?");
            return null;
        }
View Full Code Here

   
    // ------- Action Bean storage -------

    private ActionProxy getActionProxy(ActionContext context)
    {
        ActionInvocation invocation = context.getActionInvocation();
        if (invocation==null)
        {
            log.error("Action Invocation cannot be obtained. Calling from action constructor?");
            return null;
        }
        ActionProxy proxy = invocation.getProxy();
        if (proxy==null)
        {
            log.error("ActionProxy cannot be obtained. Calling from action constructor?");
            return null;
        }
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.util.PropertiesReader

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.