• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2664
  • Last Modified:

JAVA STRUTS JSP

Hi All,

I am very new to struts, know little java and some jsp.. so kindly be patient with me.
I work for a company who create software and sells it, but since business was down, so they laid of people. Now we have got a requirement which if we accomplish will give us business back and thus we will able to hire peopl back. but for making this requirement, I have to follow same archiecture that they have provided and accomplish it..

they use java/struts/jsp/weblogic6.1 in this software..unfortutanely i don't know anything about struts and right now i have to deliver this by tomorrow. So I need help from you experts accomplishing this..

I have to design a jsp page which has some commands dropdown (should come from sybase db). I have a table defined..

I don't know how to design a jsp using struts tags etc and how to follow their architcure..

hope u guys can help me while I will provide you max information what is going on here..

I have a jsp now called listCommands.jsp and I have a struts-config.xml called

admin-struts-config.xml

when somebody hit listCommands.jsp -- it should go to some class -- establish a jdbc conn, get the values of dropdown and print it..

in admin-struts-config.xml, I have as below:

   <action path="/command"
            type="com.citi.soft.struts.action.commands.CommandAction"  
            scope="request"
            validate="false">
        <forward name="listCommands" path="/jsp/admin/dev/listCommands.jsp" />
      </action>


and in listCommands.jsp, right now I have:

<%@ taglib uri='struts/bean-el' prefix='bean' %>
<%@ taglib uri='struts/html' prefix='html' %>
<%@ taglib uri='struts/logic-el' prefix='logic' %>
<%@ taglib uri='jstl/c' prefix='c' %>
<!-- <form name="commandForm" action="/isoft/iSoft/CommandServlet"> -->

<html:form action="/command"  method="post">
<table border='0' cellpadding='2' cellspacing='2'>
<tr>
  <td>


<html:select styleClass="inputtextmedium" styleId="select5" property="test">
           <html:option value="All">All</html:option>
           <html:options collection="UniqueKeyName" property="code" labelProperty="codeDesc" />          
</html:select>

</html:form>

and my CommandAction class looks as below:

package com.citi.soft.struts.action.commands;

import org.apache.struts.action.*;
import org.apache.commons.beanutils.*;
import org.apache.struts.action.*;
import com.citi.soft.common.*;
import com.citi.soft.profile.*;
import com.citi.soft.reports.*;
import com.citi.soft.common.delegator.*;
import com.citi.soft.util.logging.*;
import com.citi.soft.util.email.*;
import com.citi.soft.web.*;
import com.citi.soft.deals.*;
import com.citi.soft.struts.common.* ;
import java.util.* ;
import java.net.*;
import java.io.*;
import javax.servlet.http.*;
import java.sql.*;
import javax.sql.DataSource;
import com.citi.soft.util.jndi.* ;
import com.citi.soft.struts.action.* ;
import java.text.SimpleDateFormat;
import com.citi.soft.reference.*;


public class CommandAction
    extends Action  {
private final static String BEANCLASS = "com.citi.soft.commands.CommandsList";
    public ActionForward execute(ActionMapping actionMapping,
                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {

          System.out.println("in CommandAction execute");
        LogRecord m_lrec = new LogRecord();
          Connection conn = null;
                String keyName;
                ArrayList UniqueKeyName = new ArrayList();
               
       
        try
            {
                conn = ServiceLocator.getInstance().getDataSource(com.citi.soft.common.sql.DataSourceName.SOFTDLR.getName()).getConnection();
              Statement stmt = conn.createStatement();
                String sql = "select * from iSoftKeyValueTb";
               
             
                  ResultSet rs = stmt.executeQuery(sql);

                  while(rs.next()){
                        keyName = rs.getString("keyname").trim();
                        System.out.println("KeyName is : " + keyName);
                        m_lrec.add(MsgType.GEN, keyName);
                        ReferenceBean myref2 = new ReferenceBean();
                        myref2.setCode(keyName);
                        myref2.setCodeDesc(keyName);
                        UniqueKeyName.add(myref2);
                  }
                  request.setAttribute("UniqueKeyName",UniqueKeyName);
            }
            catch(SQLException sqlEx) {
                  System.out.println("Exception is : "+ sqlEx);
                  sqlEx.printStackTrace();            
                  ActionErrors errors = new ActionErrors();
                  ActionError error1 = new ActionError("errors.submitreport.report.error.sql");
                           errors.add( ActionErrors.GLOBAL_ERROR, error1 );
                  saveErrors( request, errors );
                  return actionMapping.findForward("failure");
            }
            finally {
                  try
                  {
                        conn.close();            
                  }
                  catch (SQLException ignored)
                  {
                  }
                 }
       
        return actionMapping.findForward("listCommands");

     }
     
     }
     


I have copied some stuff from here and there..

Can you please guide me how to accomplish this requirement.. how to make it work.. what else i am missing..

finally, when drop-down comes on page, there will be a submit button, which should send the chosen value from select list and should execute some commands, and bring the results back on a different frame (I will split the page in frames later)...


I know this is like teaching struts to me, but I want to learn and also meet my deadline, I will read the websites and books after I deliver this anyway, since if we accomplish this, we will able to bring our guys back as well as I will have learn .. for now, if you can help me, i would appreciate
0
hunky_sh
Asked:
hunky_sh
  • 38
  • 29
  • 3
1 Solution
 
petmagdyCommented:
ok u seems on the right track, did u created a web module whose struture is this:

webroot
 | ----------> /jsp/admin/dev/listCommands.jsp
 |------------>WEB-INF/web.xml
 |------------> WEB-INF/admin-struts-config.xml
 |------------->WEB-INF/*.tld   (the tag librariees)
 |------------->WEB-INF/lib/*.jar (Jar files for struts including struts.jar,commons-beanutils.jar, commons-collections.jar, commons-digester.jar, commons-fileupload.jar, commons-lang.jar, commons-logging.jar, commons-validator.jar, jakarta-oro.jar
 |---------->WEB-INF/classes/com/citi/soft/struts/action/commands/*.java (starting from WEB-INF/classes is the base for ur java classes like action

also in ur web.xml their must be:

  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/admin-struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>2</param-value>
    </init-param>
    <init-param>
      <param-name>validate</param-name>
      <param-value>true</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

now package this as war and deploy, the run:

http://host:7001/myWebApp/command.do
0
 
petmagdyCommented:
just little correctiom
>>  |---------->WEB-INF/classes/com/citi/soft/struts/action/commands/*.java (starting from WEB-INF/classes is the base for ur java classes like action

offcourse i mean *.class the complied classes
0
 
hunky_shAuthor Commented:
Yes, I did this..

This is the error I got

in CommandAction execute
KeyName is : iSoft Tail 1000 SERVER_LOG
<Nov 23, 2004 12:19:08 PM EST> <Error> <HTTP> <[WebAppServletContext(2982206,isoft/iSoft,/isoft/iSoft)] Root cause of ServletException
javax.servlet.jsp.JspException: Cannot retrieve definition for form bean null
        at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:831)
        at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
        at jsp_servlet._jsp._admin._dev.__listCommands._jspService(__listCommands.java:112)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
        at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:250)
        at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
        at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at com.citi.soft.struts.action.servlet.iSoftActionServlet.process(Unknown Source)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
petmagdyCommented:
in the way u coded ur action the action had to be called that after finish db retrievel will forward to listCommands.jsp is that what u do?
0
 
kiranhkCommented:
you do not have the form bean defined in your action mapping ..
post your struts-config.xml here...


you need to define your form bean with a variable wich is having the same name as your drop down box..

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class MyActionForm extends ActionForm {

    private String test= "";

    // ------------------------------------------------------------ Constructors

    /**
     * Constructor for MyActionForm.
     */
    public MyActionForm() {
        super();
    }

    // ---------------------------------------------------------- Public Methods

    /**
     *
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {

        /*
         * The ActionForm reset method should only be used to *clear*
         * checkboxes. The correct place to *set* default checkbox values is in
         * the 'prepare' action, called prior to displaying the form page.
         */
        this.test = "";
             
    }

    /**
     * Validate the properties that have been set from this HTTP request,
     * and return an <code>ActionErrors</code> object that encapsulates any
     * validation errors that have been found.  If no errors are found, return
     * <code>null</code> or an <code>ActionErrors</code> object with no
     * recorded error messages.
     *
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     *
     * @return ActionErrors if any validation errors occurred
     */
    public ActionErrors validate(
        ActionMapping mapping,
        HttpServletRequest request) {
       
        /*
         * We're not doing any validation (yet) so return null to
         * indicate that there were no errors. (We don't
         * actually need to override this nethod unles we're doing
         * validation - but it's here for reference)
         */
        return null;
    }


    /**
     * Returns the test.
     * @return String[]
     */
    public String getTest() {
        return test;
    }

    /**
     * Sets the test.
     * @param test
     */
    public void setColor(String tests) {
        this.test = colors;
    }

}

after this add this entry into your struts-config.xml

<form-bean name="simpleForm" type="MyActionForm"/>

then change your action mapping to this

   <action path="/command"
          type="com.citi.soft.struts.action.commands.CommandAction"  name="simpleForm"
          scope="request"
          validate="false">
        <forward name="listCommands" path="/jsp/admin/dev/listCommands.jsp" />
     </action>
0
 
hunky_shAuthor Commented:
I am getting error now:

<Nov 23, 2004 4:37:15 PM EST> <Error> <HTTP> <[WebAppServletContext(2191221,isoft/iSoft,/isoft/iSoft)] Servlet failed with Exception
java.lang.NullPointerException
        at org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:854)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at com.citi.soft.struts.action.servlet.iSoftActionServlet.process(Unknown Source)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
0
 
kiranhkCommented:
what is this server class doing iSoftActionServlet..
can you post the code
0
 
hunky_shAuthor Commented:
package com.citi.soft.struts.action.servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import org.apache.struts.action.*;
import org.apache.struts.util.*;

import com.citi.soft.common.*;
import com.citi.soft.common.dao.*;
import com.citi.soft.common.delegator.*;
import com.citi.soft.exception.*;
import com.citi.soft.profile.*;
import com.citi.soft.reference.*;
import com.citi.soft.vendor.*;
import com.citi.soft.web.WebKeys;  
import com.citi.soft.util.logging.*;

/**
 * <p>Title: iSoftActionServlet</p>
 * <p>Description: All the request to the webapplication are routed to iSoftActionServlet.
 * <br />All the reference data Like countries,currencies etc are populated in the application context.</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: Citigroup</p>
 * @author Scot Brady
 * @version 1.0
 */


public class iSoftActionServlet extends ActionServlet {
      
      private static final String CNAME = "com.citi.soft.struts.action.servlet.iSoftActionServlet";
      private UserDAO udao;
      private static Logger logger;
      
      public void init() throws ServletException {
          
          ServletContext mServletContext = null;
            LogRecord lrec = new LogRecord();
            System.out.println("Getting a LOGGER in iSoftActionServlet");
            logger = Logger.getLogger(CNAME);
            System.out.println("Finished getting a LOGGER in iSoftActionServlet");
            
            try {
                  super.init();
                  
                  // get reference to user dao as it's needed repreatedly in process()
              udao = (UserDAO) DAOFactory.getDAO(DAOTypeImpl.USER);
              
              // now do real init stuff
                  mServletContext = getServletContext();
                  
                  Delegator m_delegator = Delegator.getInstance();
                  ReferenceContext rc = new ReferenceContext();
                  
                  rc.COUNTRIES = true;
                  rc.CURRENCIES = true;
                  rc.VENDORCATEGORIES = true;
                  rc.VENDORTYPES = true;
                  rc.VENDORSTATUS = true;
                  rc.DEALSTATUS = true;
                  rc.REPORTINGTYPES = true;
                  rc.COSTCENTERCODES = true;
                  rc.DEALTYPES = true;
                  rc.SDSREPS = true;
                  rc.INVOICESTATUS = true;
                  rc.PAYMENTSTATUS = true;
                  rc.APLOCTYPES = true;
                  rc.CLIENTSTATUS = true;
                  rc.VENDORCONTACTTYPES = true;
                  rc.CLIETNCONTACTTYPES = true;
                  rc.VENDORCONTRACTSTATUS = true;
                  rc.VENDORCONTRACTTERM = true ;
                  rc.VAT_TYPE = true ;
                  
                  /***** ratio section starts ***/
                  rc.RATIO_FILTER = true;
                  rc.SCHED_FILTER = true;
                  rc.CALC_FILTER = true;
                  rc.RATIO_ACT_TYPE = true;
                  rc.SCHED_ACT_TYPE = true;
                  rc.RATIO_COMPONENT = true;

                  rc.MARKET = true;
                  rc.PRODUCT = true;
                  rc.EXCHANGE = true;
                  rc.TRADEAREA = true;
                  rc.BLOTTERCODE = true;
                  /***** ratio section ends ***/

                  //states lov
                  rc.STATES=true;
                  
                  AggregateInput rfInput = new AggregateInput();
                  rfInput.setValueObject(rc);
                  rfInput.setBusinessEntity("REFERENCE");
                  rfInput.setBusinessAction("GETREFERENCEINFO");
                  ReferenceAggregateOutput agOut = (ReferenceAggregateOutput)
                        m_delegator.processRequest(rfInput);
                  
                  
                  /* SET GENERAL CODES */
                  mServletContext.setAttribute(WebKeys.COUNTRIES, agOut.getCountries());
                  addLogRec(agOut.getCountries(), "Countries", lrec);
                  mServletContext.setAttribute(WebKeys.CURRENCIES, agOut.getCurrencies());
                  addLogRec(agOut.getCurrencies(), "Currencies", lrec);
            mServletContext.setAttribute(WebKeys.DEAL_COSTCENTERCODES, agOut.getCostCenterCodes());
                  addLogRec(agOut.getCostCenterCodes(), "CostCenterCodes", lrec);
            mServletContext.setAttribute(WebKeys.SDSREPS, agOut.getSDSReps());
                  addLogRec(agOut.getSDSReps(), "SDSReps", lrec);
            mServletContext.setAttribute(WebKeys.STATES, agOut.getStates());
                  addLogRec(agOut.getStates(), "States", lrec);
            mServletContext.setAttribute(WebKeys.MARKET, agOut.getMarkets());
            addLogRec(agOut.getMarkets(), "Market", lrec);            
            mServletContext.setAttribute(WebKeys.PRODUCT, agOut.getProduct());      
                  addLogRec(agOut.getProduct(), "Product", lrec);
                  mServletContext.setAttribute(WebKeys.TRADE_AREA, agOut.getTradeArea());
                  addLogRec(agOut.getTradeArea(), "Trade Area", lrec);            
                  mServletContext.setAttribute(WebKeys.EXCHANGE, agOut.getExchange());
                  addLogRec(agOut.getExchange(), "Exchange", lrec);
                  mServletContext.setAttribute(WebKeys.BLOTTER_CODE, agOut.getBlotterCode());
                  addLogRec(agOut.getBlotterCode(), "Blotter Code", lrec);
                  
                  /* VENDOR CODES */
                  mServletContext.setAttribute(WebKeys.VNDR_CATEGORIES, agOut.getVendorCategories());
                  addLogRec(agOut.getVendorCategories(), "Vendor categories", lrec);
            mServletContext.setAttribute(WebKeys.VNDR_TYPES, agOut.getVendorTypes());
            addLogRec(agOut.getVendorTypes(), "Vendor Types", lrec);
                  mServletContext.setAttribute(WebKeys.VNDR_STATUSES,      agOut.getVendorStatus());
            addLogRec(agOut.getVendorStatus(), "Vendor Status", lrec);
            mServletContext.setAttribute(WebKeys.VNDR_CONTACTTYPES,      agOut.getVendorContactTypes());
                  addLogRec(agOut.getVendorContactTypes(), "Vendor Contact Type", lrec);
                  
                  /* RATIO CODES */
                  mServletContext.setAttribute(WebKeys.RATIO_FILTER, agOut.getRatioFilter());
                  addLogRec(agOut.getRatioFilter(), "Ratio Filter", lrec);
                  mServletContext.setAttribute(WebKeys.SCHED_FILTER, agOut.getSchedFilter());
            addLogRec(agOut.getSchedFilter(), "Schedule Filter", lrec);
            mServletContext.setAttribute(WebKeys.RATIO_ACT_TYPE, agOut.getRatioActType());
                  addLogRec(agOut.getRatioActType(), "Ratio Act Type", lrec);
                  mServletContext.setAttribute(WebKeys.SCHED_ACT_TYPE, agOut.getSchedActType());
                  addLogRec(agOut.getSchedActType(), "Schedule Action Type", lrec);
                  mServletContext.setAttribute(WebKeys.CALC_FILTER, agOut.getCalcFilter());
                  addLogRec(agOut.getCalcFilter(), "Calc Filter", lrec);
                  mServletContext.setAttribute(WebKeys.RATIO_ACT_TYPE, agOut.getRatioActType());
                  addLogRec(agOut.getRatioActType(), "Ratio Act Type", lrec);
                  mServletContext.setAttribute(WebKeys.SCHED_ACT_TYPE, agOut.getSchedActType());
                  addLogRec(agOut.getSchedActType(), "Schedule Action Type", lrec);
                  mServletContext.setAttribute(WebKeys.RATIO_COMPONENT, agOut.getRatioComponent());
              addLogRec(agOut.getRatioComponent(), "Ratio Component", lrec);
                   
                  /* DEAL CODES */
                  mServletContext.setAttribute(WebKeys.DEAL_VENDORTERM, agOut.getDealVendorContractTerm());
                  addLogRec(agOut.getDealVendorContractTerm(), "Deal Vendor Contract Term", lrec);
                  mServletContext.setAttribute(WebKeys.DEAL_VENDORSTATUS, agOut.getDealVendorContractStatus());
                  addLogRec(agOut.getDealVendorContractStatus(), "Deal Vendor Contract Status", lrec);
                  mServletContext.setAttribute(WebKeys.DEAL_STATUS, agOut.getDealStatus());
            addLogRec(agOut.getDealStatus(), "Deal Status", lrec);
            mServletContext.setAttribute(WebKeys.DEAL_REPTYPES, agOut.getDealReportingTypes());
                  addLogRec(agOut.getDealReportingTypes(), "Deal Reporting Type", lrec);
                  mServletContext.setAttribute(WebKeys.DEAL_TYPES, agOut.getDealTypes());
            addLogRec(agOut.getDealTypes(), "Deal Type", lrec);
                  
                  /* INVOICE / PAYMENT CODES */
                  mServletContext.setAttribute(WebKeys.INV_STATUSES,      agOut.getInvoiceStatus());
                  addLogRec(agOut.getInvoiceStatus(), "Invoice Status", lrec);
                  mServletContext.setAttribute(WebKeys.PAY_STATUSES,      agOut.getPaymentStatus());
                  addLogRec(agOut.getPaymentStatus(), "Payment Status", lrec);
                  mServletContext.setAttribute(WebKeys.APLOC_TYPES, agOut.getApLocTypes());
                  addLogRec(agOut.getApLocTypes(), "AP Loction Types", lrec);      

                  
                  /* CLIENT CODES */
                  mServletContext.setAttribute(WebKeys.CLIENT_STATUSES, agOut.getClientStatus());
                  addLogRec(agOut.getClientStatus(), "Client Status", lrec);
                  mServletContext.setAttribute(WebKeys.CLIENT_CONTACTTYPES,      agOut.getClientContactTypes());
                  addLogRec(agOut.getClientContactTypes(), "Client Contact Types", lrec);

                  /* VAT TYPES */
                  mServletContext.setAttribute(WebKeys.VATTYPES , agOut.getVatTypes());
                  addLogRec(agOut.getVatTypes(), "Vat Types", lrec);

                  // LOG ANY ERRORS
                  if (lrec.toString().length() > 0) {
                      // something was added to log rec above, not good.
                      logger.alert(lrec);
                  }
                  
                  
            } catch (DelegatorException dgexp) {
                  lrec.add(MsgType.EXCPT, "DelegatorException caught in iSoftActionServlet::init()", dgexp);
                  logger.alert(lrec);
            } catch (BusinessEntityNotFoundException begexp) {
                  lrec.add(MsgType.EXCPT, "BusinessEntityNotFoundException caught in iSoftActionServlet::init()", begexp);
                  logger.alert(lrec);
            }  catch (Exception e) {
                  lrec.add(MsgType.EXCPT, "Exception caught in iSoftActionServlet::init()", e);
                  logger.alert(lrec);
            } finally {}
            
      }
      
    protected void setCurrentURIasWebKey(LogRecord rec, HttpServletRequest req){
            req.setAttribute(WebKeys.PREV_URI,req.getServletPath());
            rec.add(MsgType.STATE, "WebKeys.PREV_URI was set to " + req.getServletPath());
            logger.debug(rec);
      }

      protected void process(HttpServletRequest req,
            HttpServletResponse res) throws IOException,
            ServletException {
            
            LogRecord rec = new LogRecord();
            long start = System.currentTimeMillis();
            
            setCurrentURIasWebKey(rec, req);
            
            String userid = "";
            HttpSession sess = req.getSession(true);
            if (sess.getAttribute(WebKeys.USER) == null || ((User)sess.getAttribute(WebKeys.USER)).getUserId() == iSoftConstants.UNKNOWN_USER) {
                userid = req.getRemoteUser();
                rec.add(MsgType.STATE, "user: " + userid + " is not in session");
                logger.debug(rec);
                  // setup User
                  try {
                        
                        if (userid == null || userid.trim().equals("")) {
                              userid = iSoftConstants.UNKNOWN_USER;
                              rec.add(MsgType.STATE, "userid is not available... making userid: " + iSoftConstants.UNKNOWN_USER);
                              logger.debug(rec);
                        }
                        
                        User user = udao.getUser(userid.trim().toUpperCase());
                        sess.setAttribute(WebKeys.USER, user);
                        rec.add(MsgType.STATE, "added user object to session");
                        logger.debug(rec);
                  } catch (Exception e) {
                      rec.add(MsgType.EXCPT, "Exception caught in iSoftActionServlet::process() creating user", e);
                      logger.warn(rec);
                      sess.setAttribute(WebKeys.USER, null);
                  }
            } else {
                userid = ((User)sess.getAttribute(WebKeys.USER)).getUserId();
            }
            rec.add(MsgType.STATE, "finished User setup, invoking Struts process method..");
            logger.debug(rec);
            
            super.process(req, res);
            rec.add(MsgType.GEN, ((System.currentTimeMillis()-start)/1000) + " seconds to process request for userid: " + userid);
            logger.info(rec);
            
            
      }
      
      public void destroy() {
      }
      
      private void addLogRec(Collection coll, String name, LogRecord lrec) {
          if (null == coll) {
                  lrec.add(MsgType.EXCPT, name + " collection is null");
            }
      }
}
0
 
kiranhkCommented:
can you also post your web.xml and struts-config.xml
0
 
hunky_shAuthor Commented:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

      <servlet>
            <servlet-name>CreateExcel</servlet-name>
            <servlet-class>com.citi.soft.trade.CreateExcelServlet</servlet-class>
      </servlet>
   
      <servlet>
          <servlet-name>CommandServlet</servlet-name>
            <servlet-class>com.citi.soft.commands.CommandServlet</servlet-class>
      </servlet>
      
  <servlet>
      <servlet-name>action</servlet-name>
      <servlet-class>com.citi.soft.struts.action.servlet.iSoftActionServlet</servlet-class>
      <init-param>
        <param-name>application</param-name>
        <param-value>ApplicationResources</param-value>
      </init-param>
      <!-- STRUTS CONFIG FILES
    <init-param>
        <param-name>config</param-name>
        <param-value>/WEB-INF/struts-config/struts-config.xml</param-value>
      </init-param>-->
    <init-param>
      <param-name>config</param-name>
  <param-value>/WEB-INF/struts-config/admin-struts-config.xml,/WEB-INF/struts-config/matrix-struts-config.xml,/WEB-INF/struts-config/invoice-struts-config.xml,/WEB-INF/struts-config/client-struts-config.xml,/WEB-INF/struts-config/vendor-struts-config.xml,/WEB-INF/struts-config/trade-struts-config.xml,/WEB-INF/struts-config/deals-struts-config.xml,/WEB-INF/struts-config/ratio-struts-config.xml,/WEB-INF/struts-config/report-struts-config.xml,/WEB-INF/struts-config/contact-struts-config.xml,/WEB-INF/struts-config/notes-struts-config.xml,/WEB-INF/struts-config/alerts-struts-config.xml,/WEB-INF/struts-config/moneymanager-struts-config.xml,/WEB-INF/struts-config/users-struts-config.xml,/WEB-INF/struts-config/isoftresources-struts-config.xml,/WEB-INF/struts-config/accounts-struts-config.xml</param-value>
    </init-param>
      <!-- STRUTS CONFIG FILES -->
      <init-param>
        <param-name>debug</param-name>
        <param-value>2</param-value>
      </init-param>
      <init-param>
        <param-name>detail</param-name>
        <param-value>2</param-value>
      </init-param>
      <init-param>
        <param-name>validate</param-name>
        <param-value>true</param-value>
      </init-param>
      <load-on-startup>2</load-on-startup>
  </servlet>
   <servlet>
    <servlet-name>displaydocument</servlet-name>
    <servlet-class>com.citi.soft.invoice.DisplayDocument</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>invvendorlov</servlet-name>
    <servlet-class>com.citi.soft.common.InvVendorLov</servlet-class>
  </servlet>
 

  <!-- Standard Action Servlet Mapping -->
  <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>displaydocument</servlet-name>
    <url-pattern>/displaydocument</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>invvendorlov</servlet-name>
    <url-pattern>/invvendorlov</url-pattern>
  </servlet-mapping>
 
  <servlet-mapping>
    <servlet-name>CommandServlet</servlet-name>
    <url-pattern>/CommandServlet</url-pattern>
  </servlet-mapping>
 
   <mime-mapping>
    <extension>bmp</extension>
    <mime-type>image/bmp</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>class</extension>
    <mime-type>application/x-java-vm</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>doc</extension>
    <mime-type>application/doc</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>exe</extension>
    <mime-type>application/octet-stream</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>gif</extension>
    <mime-type>image/gif</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>htm</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>jar</extension>
    <mime-type>application/x-java-archive</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>jpeg</extension>
    <mime-type>image/jpeg</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>jpg</extension>
    <mime-type>image/jpeg</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>pdf</extension>
    <mime-type>application/pdf</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>ser</extension>
    <mime-type>application/x-java-serialized</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>xls</extension>
    <mime-type>application/xls</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>zip</extension>
    <mime-type>application/zip</mime-type>
  </mime-mapping>

  <!-- The Usual Welcome File List -->
  <welcome-file-list>
      <welcome-file>jsp/home.jsp</welcome-file>
  </welcome-file-list>

  <!-- Struts Tag Library Descriptors -->

 <!-- Template Tag Library Descriptor -->
  <taglib>
      <taglib-uri>template.tld</taglib-uri>
      <taglib-location>/WEB-INF/tld/struts-template.tld</taglib-location>
  </taglib>

  <taglib>
      <taglib-uri>struts/bean-el</taglib-uri>
      <taglib-location>/WEB-INF/tld/struts-bean-el.tld</taglib-location>
  </taglib>

  <taglib>
      <taglib-uri>struts/bean</taglib-uri>
      <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
  </taglib>
 
<taglib>
        <taglib-uri>isoft</taglib-uri>
        <taglib-location>/WEB-INF/tld/isoft.tld</taglib-location>
</taglib>

  <taglib>
      <taglib-uri>struts/html-el</taglib-uri>
      <taglib-location>/WEB-INF/tld/struts-html-el.tld</taglib-location>
  </taglib>

  <taglib>
      <taglib-uri>struts/html</taglib-uri>
      <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
  </taglib>

  <taglib>
      <taglib-uri>struts/logic-el</taglib-uri>
      <taglib-location>/WEB-INF/tld/struts-logic-el.tld</taglib-location>
  </taglib>

  <taglib>
      <taglib-uri>struts/logic</taglib-uri>
      <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
  </taglib>

  <taglib>
      <taglib-uri>jstl/c</taglib-uri>
      <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
  </taglib>

  <taglib>
      <taglib-uri>jstl/fmt</taglib-uri>
      <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
  </taglib>

 <taglib>
      <taglib-uri>struts/nested</taglib-uri>
      <taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location>
  </taglib>  

</web-app>

and since here they have different struts-config.xml for each module..

i am working on admin-struts-config.xml which is as below:

<!DOCTYPE struts-config PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
      "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd" >
<struts-config>
 <form-bean name="simpleForm" type="MyActionForm"/>  
       
        <!--  Action Mapping Definitions  -->
    <action-mappings>
        <action path="/admin" forward="/jsp/adminHome.jsp"/>
           
        <action path="/command"
            type="com.citi.soft.struts.action.commands.CommandAction name="simpleForm"  
            scope="request"
            validate="false">
        <forward name="listCommands" path="/jsp/admin/dev/listCommands.jsp" />
      </action>
      
    </action-mappings>

      <!-- message resources -->
    <message-resources parameter="ApplicationResources" null="false" />

    <!--  plugins -->  
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator/validator-rules.xml,/WEB-INF/validator/validation.xml"/>
    </plug-in>


      
</struts-config>
0
 
kiranhkCommented:
yes.... precisely the problem is it is not able to get the RequestProcessor for your particular module..
0
 
kiranhkCommented:
can you check out what mapping they have for RequestProcessor for other modules....
0
 
hunky_shAuthor Commented:
hmm,

how can  i check it sorry?

would it be in some other struts-config.xml file?

just for your reference, below is one more struts-config.xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
  <form-beans>
    <form-bean name="uploadForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="fileName" type="java.lang.String" />
      <form-property name="uploadedFile" type="org.apache.struts.upload.FormFile" />
      <form-property name="methodToCall" type="java.lang.String" />
      <form-property name="isExists" type="java.lang.String" />
      <form-property name="docReferer" type="java.lang.String" />
      <form-property name="invSeqId" type="java.lang.String" />
    </form-bean>
    <form-bean name="confirmForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="Id" type="java.lang.String" />
    </form-bean>
    <form-bean name="invoiceForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="invId" type="java.lang.String" />
      <form-property name="ccNum" type="java.lang.String" />
      <form-property name="ccName" type="java.lang.String" />
      <form-property name="vendorAPName" type="java.lang.String" />
      <form-property name="vendorId" type="java.lang.String" />
      <form-property name="vendorAccountNo" type="java.lang.String" />
      <form-property name="dealMNC" type="java.lang.String" />
      <form-property name="vendorAccNum" type="java.lang.String" />
      <form-property name="planType" type="java.lang.String" />
      <form-property name="dealN" type="java.lang.String" />
      <form-property name="apRefId" type="java.lang.String" />
      <form-property name="fromDate" type="java.lang.String" />
      <form-property name="toDate" type="java.lang.String" />
      <form-property name="dueDt" type="java.lang.String" />
      <form-property name="effDt" type="java.lang.String" />
      <form-property name="invDt" type="java.lang.String" />
      <form-property name="apLocId" type="java.lang.String" />
      <form-property name="softRatio" type="java.lang.String" />
      <form-property name="isHardCoded" type="java.lang.String" />
      <form-property name="softAmt" type="java.lang.String" />
      <form-property name="invStatus" type="java.lang.String" />
      <form-property name="comments" type="java.lang.String" />
      <form-property name="fromServiceDt" type="java.lang.String[]" />
      <form-property name="toServiceDt" type="java.lang.String[]" />
      <form-property name="serviceDetails" type="java.lang.String[]" />
      <form-property name="unitCost" type="java.lang.String[]" />
      <form-property name="qnty" type="java.lang.String[]" />
      <form-property name="unitTotal" type="java.lang.String[]" />
      <form-property name="total" type="java.lang.String" />
      <form-property name="ccy" type="java.lang.String" />
      <form-property name="action" type="java.lang.String" />
      <form-property name="currentDt" type="java.lang.String" />
      <form-property name="id" type="java.lang.String" />
      <form-property name="name" type="java.lang.String" />
      <form-property name="vendorSite" type="java.lang.String" />
      <form-property name="apNo" type="java.lang.String" />
      <form-property name="appUsrI" type="java.lang.String" />
    </form-bean>
    <form-bean name="editInvoiceForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="ccNum" type="java.lang.String" />
      <form-property name="ccName" type="java.lang.String" />
      <form-property name="ccMNC" type="java.lang.String" />
      <form-property name="vendorAPName" type="java.lang.String" />
      <form-property name="vendorId" type="java.lang.String" />
      <form-property name="vendorAccountNo" type="java.lang.String" />
      <form-property name="dealMNC" type="java.lang.String" />
      <form-property name="dealN" type="java.lang.String" />
      <form-property name="repCcy" type="java.lang.String" />
      <form-property name="repGrossPay" type="java.lang.String" />
      <form-property name="vendorAccNum" type="java.lang.String" />
      <form-property name="planType" type="java.lang.String" />
      <form-property name="apRefId" type="java.lang.String" />
      <form-property name="invId" type="java.lang.String" />
      <form-property name="fromDate" type="java.lang.String" />
      <form-property name="toDate" type="java.lang.String" />
      <form-property name="dueDt" type="java.lang.String" />
      <form-property name="effDt" type="java.lang.String" />
      <form-property name="invDt" type="java.lang.String" />
      <form-property name="apLocId" type="java.lang.String" />
      <form-property name="softRatio" type="java.lang.String" />
      <form-property name="isHardCoded" type="java.lang.String" />
      <form-property name="softAmt" type="java.lang.String" />
      <form-property name="invStatus" type="java.lang.String" />
      <form-property name="comments" type="java.lang.String" />
      <form-property name="fromServiceDt" type="java.lang.String[]" />
      <form-property name="toServiceDt" type="java.lang.String[]" />
      <form-property name="serviceDetails" type="java.lang.String[]" />
      <form-property name="unitCost" type="java.lang.String[]" />
      <form-property name="qnty" type="java.lang.String[]" />
      <form-property name="unitTotal" type="java.lang.String[]" />
      <form-property name="total" type="java.lang.String" />
      <form-property name="ccy" type="java.lang.String" />
      <form-property name="actionType" type="java.lang.String" />
      <form-property name="entryDt" type="java.lang.String" />
      <form-property name="invSeqId" type="java.lang.String" />
      <form-property name="apSentDt" type="java.lang.String" />
      <form-property name="checkId" type="java.lang.String" />
      <form-property name="checkDt" type="java.lang.String" />
      <form-property name="status" type="java.lang.String" />
      <form-property name="foreignRate" type="java.lang.String" />
      <form-property name="foreignAmt" type="java.lang.String" />
      <form-property name="methodToCall" type="java.lang.String" />
      <form-property name="totalAsString" type="java.lang.String" />
      <form-property name="aPSentDtAsString" type="java.lang.String" />
      <form-property name="checkDtAsString" type="java.lang.String" />
      <form-property name="softAmtAsString" type="java.lang.String" />
      <form-property name="dealType" type="java.lang.String" />
      <form-property name="actvyDt" type="java.lang.String" />
      <form-property name="lastActvyDt" type="java.lang.Long" />
      <form-property name="lastActvyUsrI" type="java.lang.String" />
      <form-property name="currentDt" type="java.lang.String" />
      <form-property name="vendorSiteC" type="java.lang.String" />
      <form-property name="appUsrI" type="java.lang.String" />
    </form-bean>
    <form-bean name="invSearchForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="dealMnc" type="java.lang.String" />
      <form-property name="dealId" type="java.lang.String" />
      <form-property name="effDt" type="java.lang.String" />
    </form-bean>
    <form-bean name="paymentForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="invId" type="java.lang.String" />
      <form-property name="apRefId" type="java.lang.String" />
      <form-property name="invSeqId" type="java.lang.String" />
      <form-property name="vendorName" type="java.lang.String" />
      <form-property name="action" type="java.lang.String" />
      <form-property name="checkId" type="java.lang.String" />
      <form-property name="checkDt" type="java.lang.String" />
      <form-property name="confirmId" type="java.lang.String" />
      <form-property name="confirmDt" type="java.lang.String" />
      <form-property name="usAmt" type="java.lang.String" />
      <form-property name="paymentStatus" type="java.lang.String" />
      <form-property name="payType" type="java.lang.String" />
      <form-property name="foreignAmount" type="java.lang.String" />
      <form-property name="amtPaid" type="java.lang.String" />
      <form-property name="origCcy" type="java.lang.String" />
      <form-property name="spotRate" type="java.lang.String" />
      <form-property name="methodToCall" type="java.lang.String" />
      <form-property name="lastActvyDt" type="java.lang.Long" />
      <form-property name="invoiceStatus" type="java.lang.String" />
      <form-property name="status" type="java.lang.String[]" />
      <form-property name="apLoc" type="java.lang.String[]" />
      <form-property name="lasttime" type="java.lang.Long[]" />
      <form-property name="comments" type="java.lang.String" />
      <form-property name="currentDt" type="java.lang.String" />
    </form-bean>
      <form-bean name="invListSearchForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="dealMNC" type="java.lang.String" />
      <form-property name="dealId" type="java.lang.String" />
      <form-property name="vendorName" type="java.lang.String" />
      <form-property name="vendorNo" type="java.lang.String" />
      <form-property name="vendorApNo" type="java.lang.String" />
      <form-property name="vendSiteC" type="java.lang.String" />
      <form-property name="checkNo" type="java.lang.String" />
      <form-property name="checkDate" type="java.lang.String" />
      <form-property name="effDate" type="java.lang.String" />
      <form-property name="invDate" type="java.lang.String" />
      <form-property name="APSentDate" type="java.lang.String" />
      <form-property name="dueDate" type="java.lang.String" />
      <form-property name="checkDateTo" type="java.lang.String" />
      <form-property name="effDateTo" type="java.lang.String" />
      <form-property name="invDateTo" type="java.lang.String" />
      <form-property name="APSentDateTo" type="java.lang.String" />
      <form-property name="dueDateTo" type="java.lang.String" />
      <form-property name="vendorAccNo" type="java.lang.String" />
      <form-property name="paymentStatus" type="java.lang.String" />
      <form-property name="apRefId" type="java.lang.String" />
      <form-property name="invId" type="java.lang.String" />
      <form-property name="status" type="java.lang.String[]" />
      <form-property name="payType" type="java.lang.String" />
      <form-property name="selIndex" type="java.lang.String[]" />
    </form-bean>
      <form-bean name="pendingInvoicesForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="statusId" type="java.lang.String[]" />
      <form-property name="invSeqId" type="java.lang.String[]" />
      <form-property name="dealMNC" type="java.lang.String" />
      <form-property name="vendorName" type="java.lang.String" />
      <form-property name="vendorNo" type="java.lang.String" />
      <form-property name="checkNo" type="java.lang.String" />
      <form-property name="checkDate" type="java.lang.String" />
      <form-property name="effDate" type="java.lang.String" />
      <form-property name="invDate" type="java.lang.String" />
      <form-property name="APSentDate" type="java.lang.String" />
      <form-property name="dueDate" type="java.lang.String" />
      <form-property name="checkDateTo" type="java.lang.String" />
      <form-property name="effDateTo" type="java.lang.String" />
      <form-property name="invDateTo" type="java.lang.String" />
      <form-property name="APSentDateTo" type="java.lang.String" />
      <form-property name="dueDateTo" type="java.lang.String" />
      <form-property name="vendorAccNo" type="java.lang.String" />
      <form-property name="paymentStatus" type="java.lang.String" />
      <form-property name="apRefId" type="java.lang.String" />
      <form-property name="invId" type="java.lang.String" />
      <form-property name="lastActvyUsrI" type="java.lang.String" />
      <form-property name="comments" type="java.lang.String[]" />
      <form-property name="selIndex" type="java.lang.String[]" />
    </form-bean>
  </form-beans>
  <global-forwards>
    <forward name="fileUploaded" contextRelative="true" path="/jsp/uploadDocs.jsp" />
    <forward name="docsUploaded" contextRelative="true" path="/jsp/uploadDocsNoMenu.jsp" />
    <forward name="invoiceAdded" contextRelative="true" path="/jsp/invoices/addInvoicessucc.jsp" />
    <forward name="docsToBeUploaded" contextRelative="true" path="/jsp/uploadDocs.jsp" />
    <forward name="invoiceModified" contextRelative="true" path="/jsp/ModInvoice.jsp" />
    <forward name="invoiceUpdated" contextRelative="true" path="/invoice/viewInvoice.do" />
    <forward name="invoiceDeleted" contextRelative="true" path="/jsp/ListInvoices.jsp" />
    <forward name="invSearch" contextRelative="true" path="/jsp/addInvoices.jsp" />
    <forward name="invList" contextRelative="true" path="/jsp/ListInvoices.jsp" />
    <forward name="paymentsListed" contextRelative="true" path="/jsp/PayDetails.jsp" />
      <forward name="listInvoicesSelectedForPayment" contextRelative="true" path="/jsp/PayMDetails.jsp" />
      <forward name="listInvoicesForPaymentConfirm" contextRelative="true" path="/jsp/AskPayM.jsp" />
      <forward name="listInvoicesAfterPayment" contextRelative="true" path="/jsp/listPayments.jsp" />
    <forward name="paymentsConfirm" contextRelative="true" path="/jsp/paymentsucc.jsp" />
    <forward name="paymentMade" contextRelative="true" path="/invoice/viewInvoice.do?methodToCall=view" />
      <forward name="updatedpendingInvoices" contextRelative="true" path="/invoice/pendingInvoices.do?methodToCall=viewPending" />      
      <forward name="pendingInvoices" contextRelative="true" path="/jsp/pendingInvoices.jsp" />      
      <forward name="voidConfirm" contextRelative="true" path="/jsp/AskVoidInvoice.jsp" />      

  </global-forwards>
  <action-mappings>
   
    <action name="invoiceForm" type="com.citi.soft.struts.action.invoice.AddInvoiceAction" validate="false" input="/jsp/addInvoices.jsp" scope="request" path="/invoice/addInvoice" />
    <action name="uploadForm" type="com.citi.soft.struts.action.invoice.UploadInvoiceDocsAction" validate="false" input="/jsp/invoices/uploadInvoiceDocs.jsp" parameter="methodToCall" scope="request" path="/invoice/uploadInvoiceDocs" />

    <action name="editInvoiceForm" type="com.citi.soft.struts.action.invoice.ViewInvoiceAction" validate="false" input="/invoice/viewInvoice.do" scope="request" path="/invoice/viewInvoice" />

    <action name="editInvoiceForm" type="com.citi.soft.struts.action.invoice.UpdateInvoiceAction" validate="false" input="/invoice/viewInvoice.do" scope="request" path="/invoice/updateInvoice" />

      <action name="invSearchForm" type="com.citi.soft.struts.action.invoice.InvSearchAction" validate="false" input="/jsp/addinvoicessearch.jsp" scope="request" path="/invoice/searchDeal" />

      <action name="invListSearchForm" type="com.citi.soft.struts.action.invoice.InvListSearchAction" validate="false" input="/jsp/invoices/InvoiceListSearch.jsp" scope="request" path="/invoice/invListSearch" />
   
      <action name="invListSearchForm" type="com.citi.soft.struts.action.invoice.MultipleInvoiceAction" validate="false" input="/jsp/invoices/InvoiceListSearch.jsp" scope="request" path="/invoice/invPayment" parameter="methodToCall" />

      <action name="paymentForm" type="com.citi.soft.struts.action.invoice.MultipleInvoiceAction" validate="false" input="/jsp/invoices/InvoiceListSearch.jsp" scope="request" path="/invoice/invPaymentConfirm" parameter="methodToCall" />

      <action name="paymentForm" type="com.citi.soft.struts.action.invoice.PayInvoiceAction" validate="false" input="/jsp/payments/PaymentDetails.jsp" scope="request" parameter="methodToCall" path="/invoice/payInvoice" />
      <action name="confirmForm" type="com.citi.soft.struts.action.invoice.DeleteInvoiceAction" validate="false" input="/jsp/invoices/delaskright.jsp" scope="request" path="/invoice/deleteInvoice" />

      <action name="pendingInvoicesForm" type="com.citi.soft.struts.action.invoice.PendingInvoicesAction" validate="false" input="/pendingInvoices.do?methodToCall=viewPending" scope="request" path="/invoice/pendingInvoices" parameter="methodToCall"/>
      <action name="pendingInvoicesForm" type="com.citi.soft.struts.action.invoice.PendingInvoicesAction" validate="false" input="/pendingInvoices.do?methodToCall=updatePendingInv" scope="request" path="/invoice/pendingInvoices" parameter="methodToCall"/>

  </action-mappings>
  <message-resources parameter="ApplicationResources" />
  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property value="/WEB-INF/validator/validator-rules.xml, /WEB-INF/validator/validation.xml" property="pathnames" />
  </plug-in>
</struts-config>
0
 
kiranhkCommented:
ok... this seems to be problem with the migration from Struts 1.0 to 1.1

are you having Struts 1.0 jar files in the classpath of Weblogic..
0
 
hunky_shAuthor Commented:
i guess they use struts1.1. i don't know but i don't think i have struts 1.0 at all
0
 
hunky_shAuthor Commented:
Hello any help on my way here?
0
 
hunky_shAuthor Commented:
finally, i was able to figure out above problem.. and got it fixed..

I am somehow getting the results from struts.. but I need some help to correct my implementation and take me to next step please..

right now only 1 thing is missing in what I am trying to accomplish.. and I also need to correct my struts implementation because I think I am getting the results on command prompt somehow but probably it is not the right way to do it..

can somebody help now pls?

If somebody is there to help, i will post exactly what i am doing and what is missing..

0
 
kiranhkCommented:
what is the problem now...... can you rephrase your questions...
0
 
hunky_shAuthor Commented:
yes,

I will rephrase my question,

now I have a working solution..

but it is incorrect implementation.. it is working somehow, but it is not exacly according to struts implementation..
and so i need help in redesigning it and understanding how struts work..

first,

I have admin-struts-config.xml as below:

<!DOCTYPE struts-config PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
      "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd" >
<struts-config>
   
  <form-beans>

          <!-- For Statements -->
          <form-bean name="cBean" type="org.apache.struts.validator.DynaValidatorForm">
           <form-property name="test" type="java.lang.String"/>
           </form-bean>
           </form-beans>
                  
        <!--  Action Mapping Definitions  -->
    <action-mappings>
        <action path="/admin" forward="/jsp/adminHome.jsp"/>
   
        <action path="/command"
          type="com.citi.soft.struts.action.commands.CommandAction"
          name="cBean"      >
            <forward name="success" path="/jsp/admin/dev/listCommands.jsp"/>
      </action>
      
      <action path="/CommandOutput"
          type="com.citi.soft.struts.action.commands.CommandOutputAction"
          name="cBean">
          <forward name="success" path="/jsp/admin/dev/resultCommands.jsp"/>
    </action>
      
    </action-mappings>

      <!-- message resources -->
    <message-resources parameter="ApplicationResources" null="false" />

    <!--  plugins -->  
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator/validator-rules.xml,/WEB-INF/validator/validation.xml"/>
    </plug-in>

</struts-config>

Now, if i go to URL, http://....../command.do 
it invokes CommandAction and forwards to listCommand.jsp

my CommandAction is as below:

package com.citi.soft.struts.action.commands;

import org.apache.struts.action.*;
import org.apache.commons.beanutils.*;
import org.apache.struts.action.*;
import com.citi.soft.common.*;
import com.citi.soft.profile.*;
import com.citi.soft.reports.*;
import com.citi.soft.common.delegator.*;
import com.citi.soft.util.logging.*;
import com.citi.soft.util.email.*;
import com.citi.soft.web.*;
import com.citi.soft.deals.*;
import com.citi.soft.struts.common.* ;
import java.util.* ;
import java.net.*;
import java.io.*;
import javax.servlet.http.*;
import java.sql.*;
import javax.sql.DataSource;
import com.citi.soft.util.jndi.* ;
import com.citi.soft.struts.action.* ;
import java.text.SimpleDateFormat;
import com.citi.soft.reference.*;
import com.citi.soft.commands.*;


public class CommandAction
    extends iSoftAction  {
    public ActionForward execute(ActionMapping actionMapping,
                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {

          System.out.println("in CommandAction execute");
          
           Connection conn = null;
                String keyName;
                String keyValue;
                ArrayList UniqueKeyName = new ArrayList();
               
       
        try
            {
                conn = ServiceLocator.getInstance().getDataSource(com.citi.soft.common.sql.DataSourceName.SOFTDLR.getName()).getConnection();
              Statement stmt = conn.createStatement();
                String sql = "select * from iSoftKeyValueTb";
               
             
                  ResultSet rs = stmt.executeQuery(sql);

                  while(rs.next()){
                        keyName = rs.getString("keyname").trim();
                        keyValue = rs.getString("keyvalue").trim();
                        System.out.println("KeyName is : " + keyName + " and value is : " + keyValue);
                        //m_lrec.add(MsgType.GEN, keyName);
                        ReferenceBean myref2 = new ReferenceBean();
                        myref2.setCode(keyValue);
                        myref2.setCodeDesc(keyName);
                        UniqueKeyName.add(myref2);
                  }
                  request.setAttribute("UniqueKeyName",UniqueKeyName);
      
            
            
            DynaActionForm dform = (DynaActionForm)actionForm ;
            
            CommandBean cBean = new CommandBean();
            BeanUtils.copyProperties(cBean, dform );
            
            String t =  cBean.getTest();
            System.out.println("value is : " + t);
            
      } catch(SQLException sqlEx) {
                  System.out.println("Exception is : "+ sqlEx);
                  sqlEx.printStackTrace();            
                  ActionErrors errors = new ActionErrors();
                  ActionError error1 = new ActionError("errors.submitreport.report.error.sql");
                           errors.add( ActionErrors.GLOBAL_ERROR, error1 );
                  saveErrors( request, errors );
                  return actionMapping.findForward("failure");
            }
            finally {
                  try
                  {
                        conn.close();            
                  }
                  catch (SQLException ignored)
                  {
                  }
                 }
                 
           return actionMapping.findForward("success");
       

     }
     
     }

so bascially important thing here is
UniqueKeyName attribute
which is being called in listCommand.jsp as below:

<%@ taglib uri='struts/bean-el' prefix='bean' %>
<%@ taglib uri='struts/html' prefix='html' %>
<%@ taglib uri='struts/logic-el' prefix='logic' %>
<%@ taglib uri='jstl/c' prefix='c' %>


<!-- <form name="commandForm" action="/isoft/iSoft/CommandServlet"> -->

<html:form action="/CommandOutput"  method="post">
<table border='0' cellpadding='2' cellspacing='2'>
<tr>
  <td>



<html:select styleClass="inputtextmedium" styleId="select5" property="test">
           <html:option value="All">All</html:option>  
           <html:options collection="UniqueKeyName" property="code" labelProperty="codeDesc" />        
 </html:select>
            
 <html:submit styleClass="submitsmall" value ="Submit" property="button"/>
             
  </td>
  </tr>
</table>

</html:form>

So when somebody hits the URL
http://........../command.do

they get
select box with list of commands..

and they can chose a command -- and click on submit..

this should bascially excecute the command in UNIX, and bring them the response..

so action of listCommand.jsp has CommandOutput-- which has action mapping to

CommandOutputAction.java which is as below:


package com.citi.soft.struts.action.commands;

import org.apache.struts.action.*;
import org.apache.commons.beanutils.*;
import org.apache.struts.action.*;
import com.citi.soft.common.*;
import com.citi.soft.profile.*;
import com.citi.soft.reports.*;
import com.citi.soft.common.delegator.*;
import com.citi.soft.util.logging.*;
import com.citi.soft.util.email.*;
import com.citi.soft.web.*;
import com.citi.soft.deals.*;
import com.citi.soft.struts.common.* ;
import java.util.* ;
import java.net.*;
import java.io.*;
import javax.servlet.http.*;
import java.sql.*;
import javax.sql.DataSource;
import com.citi.soft.util.jndi.* ;
import com.citi.soft.struts.action.* ;
import java.text.SimpleDateFormat;
import com.citi.soft.reference.*;
import com.citi.soft.commands.*;


public class CommandOutputAction
    extends iSoftAction  {
    public ActionForward execute(ActionMapping actionMapping,
                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {

          System.out.println("in CommandOutputAction execute");
          
          String cmdStr = request.getParameter("test");
          
          System.out.println("cmdStr = " + cmdStr);
          CommandBean cmdBean = null;
          cmdBean = new CommandBean();
          cmdBean.setCommand(cmdStr);
          String output = cmdBean.getCommandOutput();
          System.out.println("output is : " + output);
          cmdBean.setOutput(output);
          request.setAttribute("OUTPUT", output);
          
          PrintWriter out = response.getWriter();
            response.setContentType("text/html");
            out.println("<html><head>");
            out.println("</head><body bgcolor='#FFFFFF'>");
            
            out.println("TEST123");
            
          
           return actionMapping.findForward("success");
       

     }
     
     }
     


Here I am just setting attribute
          request.setAttribute("OUTPUT", output);
and in my resultCommand.jsp

I have results..

resultCommand.jsp looks like as below:

<%@ taglib uri='struts/bean-el' prefix='bean' %>
<%@ taglib uri='struts/html' prefix='html' %>
<%@ taglib uri='struts/logic-el' prefix='logic' %>
<%@ taglib uri='jstl/c' prefix='c' %>
<%@ taglib uri="struts/bean" prefix="bean" %>
<%@ taglib uri="struts/logic" prefix="logic" %>
<%@ taglib uri="struts/bean" prefix="bean" %>
<%@ taglib uri="struts/html-el" prefix="html" %>
<%@ taglib uri='jstl/fmt' prefix='fmt' %>

Test result form

<%=request.getAttribute("OUTPUT")%>



and lastlly

below is my CommandBean (defined for both the Actions)

package com.citi.soft.commands;

import java.io.*;
import java.util.*;

public class CommandBean{

      /*
       ************************************************************
       * PUBLIC VARIABLES                                                            *
       ************************************************************
      */
      public static String USER_DEFINED = "USER_DEFINED";
      
      /*
       ************************************************************
       * PRIVATE VARIABLES                                                            *
       ************************************************************
      */
      
      private String m_szCommandCode = "";
      private String m_szCommand = "";
      private String m_test = "";
      private String m_output = "";
      
      /*
       ************************************************************
       * CONSTRUCTOR                                                                        *
       ************************************************************
      */

      public CommandBean(){
      }
      
      /*
       ************************************************************
       * Public SET methods                                                                        *
       ************************************************************
      */
      /**
       * sets the CommandCode
       * @param 1 (String)indicates the CommandCode from KeyValueTb(ex. IXFTP_ERROR, IXFTP_OUT...)
       * if empty string is passed, assume use will set userdefined cmd, rather than from database
       */
      public void setCommandCode(String szcode){
            if(szcode.equals("") || szcode.equals(USER_DEFINED))
                  m_szCommandCode = USER_DEFINED;
            else
                  m_szCommandCode = szcode;
      }
      /**
       * sets User specified command, so set commandCode = USER_DEFINED
       */
      public void setCommand(String commandStr){
            m_szCommandCode = USER_DEFINED;
            m_szCommand = (commandStr != null)? commandStr:"";
      }

      /*
       * Executes the command and returns the output
       */
      public String getCommandOutput(){
            String szcmd = "";
            szcmd = m_szCommand;
            String szcmdoutput = "";
            try{
                  szcmdoutput = executeCmd(szcmd);
            }catch(Exception e){
                  //catch exception here since this method is invoked thru' jsp and don't
                  //want to throw exception back
                  szcmdoutput = "CommandBean::executeCmd - Error in Executing Cmd - " + e.getMessage();                  
            }
            return szcmdoutput;
      }
      
      /**
       * public String getCommandOutput(String cmdStr) - used from main, since
       * main is public static and can not access any methods that accesses private variables
      */
      public static String getCommandOutput(String cmdStr) throws Exception{
            return executeCmd(cmdStr);
      }

      private static String executeCmd(String szcmd) throws Exception{
            if(szcmd == null || szcmd.trim().equals(""))
                  throw new Exception("CommandBean::executeCmd - No Command Specified");
                  
            StringBuffer szboutput = new StringBuffer("");
            //now that you have the command execute it!
            //not catching exception since this method is invoked thru main and we want to
            //communicate any exceptions back to it
            szboutput = executeBigSystemCmd(szcmd);
            
            return szboutput.toString();
      }
      
      /********************************************************************************************
      Start from UtilityLib.
      *********************************************************************************************/
    /*
     * returns system command results as double pipe (||) seperated string
     */
    public static String executeSystemCmd (String command) throws IOException {
        Process systemCmd = Runtime.getRuntime().exec(command);
            return getSystemCmdResultAsString(systemCmd);
    }

    public static String executeSystemCmd (String command[]) throws IOException {
        Process systemCmd = Runtime.getRuntime().exec(command);
        return getSystemCmdResultAsString(systemCmd);
    }

    private static String getSystemCmdResultAsString(Process systemCmd) throws IOException {
          String result = null;
          StringBuffer retStr = new StringBuffer("");
          BufferedReader in = new BufferedReader(new InputStreamReader(systemCmd.getInputStream()));
        while ( (result=in.readLine()) != null ) {
              if(retStr.toString().equals(""))
                    retStr.append(result);
              else
                  retStr.append("|" + result);
        }
            in.close();
        return retStr.toString();

    }

      /**
       * public static StringBuffer executeBigSystemCmd (String command[]) throws IOException
       * Use this method when the output is v.large or you want back StringBuffer or
       * you want the delimiter as newline instead of '|'
       *
      */
    public static StringBuffer executeBigSystemCmd (String command[]) throws IOException {
        Process systemCmd = Runtime.getRuntime().exec(command);
        return getSystemCmdResultAsStringBuffer(systemCmd);
    }

    public static StringBuffer executeBigSystemCmd (String command) throws IOException {
        Process systemCmd = Runtime.getRuntime().exec(command);
        return getSystemCmdResultAsStringBuffer(systemCmd);
    }

    private static StringBuffer getSystemCmdResultAsStringBuffer(Process systemCmd) throws IOException {
          String result = null;
          StringBuffer retStr = new StringBuffer("");
          BufferedReader in = new BufferedReader(new InputStreamReader(systemCmd.getInputStream()));
        while ( (result=in.readLine()) != null ) {
                  retStr.append(result+"\n");
        }
            in.close();
        return retStr;
    }
      
    public String getTest()
   {
         return this.m_test ;
   }
    public void setTest(String test)
   {
         this.m_test = test ;
   }

       public void setOutput(String output)
   {
         this.m_output = output ;
   }
   
   
       public String getOutput()
   {
         return this.m_output ;
   }
}


I know there are many errors in the code intrastructure wise..

Code is working and bringing the results -- but I need to refine it and use excatly struts framework..

Would appreciate help redefining the structures of code..

regards
0
 
kiranhkCommented:
do this
public ActionForward execute(ActionMapping actionMapping,
                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {

          DynaActionForm dform = (DynaActionForm)actionForm ;
         
          CommandBean cmdBean = new CommandBean();
          BeanUtils.copyProperties(cBean, dform );
         
         String cmdStr = cBean.getTest(); // request.getParameter("test");
         cmdBean.setCommand(cmdStr);

         //String output = cmdBean.getCommandOutput();
         //System.out.println("output is : " + output);
         //cmdBean.setOutput(output);
         request.setAttribute("OUTPUT", cmdBean.getCommandOutput());
         
         PrintWriter out = response.getWriter();
          response.setContentType("text/html");
          out.println("<html><head>");
          out.println("</head><body bgcolor='#FFFFFF'>");
         
          out.println("TEST123");
          out.flush();
         out.close();          
         
          return actionMapping.findForward("success");
       

     }


********************************************************************************************************************************
package com.citi.soft.commands;

import java.io.*;
import java.util.*;

public class CommandBean{

     /*
      ************************************************************
      * PUBLIC VARIABLES                                                  *
      ************************************************************
     */
     public final String USER_DEFINED = "USER_DEFINED";

     /*
      ************************************************************
      * PRIVATE VARIABLES                                                  *
      ************************************************************
     */

     private String m_szCommandCode = "";
     private String m_szCommand = "";
     //private String m_test = "";
     //private String m_output = "";

     /*
      ************************************************************
      * CONSTRUCTOR                                                            *
      ************************************************************
     */

     public CommandBean(){
     }

     /*
      ************************************************************
      * Public SET methods                                                            *
      ************************************************************
     */
     /**
      * sets the CommandCode
      * @param 1 (String)indicates the CommandCode from KeyValueTb(ex. IXFTP_ERROR, IXFTP_OUT...)
      * if empty string is passed, assume use will set userdefined cmd, rather than from database
      */
     public void setCommandCode(String szcode){
          if(szcode.equals("") || szcode.equals(USER_DEFINED))
          {
               m_szCommandCode = USER_DEFINED;
               m_szCommand = USER_DEFINED;
           }
          else
          {
               m_szCommandCode = szcode;
               m_szCommand = USER_DEFINED;
           }
     }
     /**
      * sets User specified command, so set commandCode = USER_DEFINED
      */
     public void setCommand(String commandStr){
          m_szCommandCode = USER_DEFINED;
          m_szCommand = (commandStr != null)? commandStr:"";
     }

     /*
      * Executes the command and returns the output
      */
     public String getCommandOutput(){
          //String szcmd = "";
          //szcmd = m_szCommand;
          String szcmdoutput = "";
          try{
               szcmdoutput = executeCmd(m_szCommand);
          }catch(Exception e){
               //catch exception here since this method is invoked thru' jsp and don't
               //want to throw exception back
               szcmdoutput = "CommandBean::executeCmd - Error in Executing Cmd - " + e.getMessage();
          }
          return szcmdoutput;
     }

     /**
      * public String getCommandOutput(String cmdStr) - used from main, since
      * main is public static and can not access any methods that accesses private variables
     */
     public static String getCommandOutput(String cmdStr) throws Exception{
          return executeCmd(cmdStr);
     }

     private static String executeCmd(String szcmd) throws Exception{
          if(szcmd == null || szcmd.trim().equals(""))
               throw new Exception("CommandBean::executeCmd - No Command Specified");

          StringBuffer szboutput = new StringBuffer("");
          //now that you have the command execute it!
          //not catching exception since this method is invoked thru main and we want to
          //communicate any exceptions back to it
          szboutput = executeBigSystemCmd(szcmd);

          return szboutput.toString();
     }

     /********************************************************************************************
     Start from UtilityLib.
     *********************************************************************************************/
    /*
     * returns system command results as double pipe (||) seperated string
     */
    public static String executeSystemCmd (String command) throws IOException {
        Process systemCmd = Runtime.getRuntime().exec(command);
          return getSystemCmdResultAsString(systemCmd);
    }

    public static String executeSystemCmd (String command[]) throws IOException {
        Process systemCmd = Runtime.getRuntime().exec(command);
        return getSystemCmdResultAsString(systemCmd);
    }

    private static String getSystemCmdResultAsString(Process systemCmd) throws IOException {
         String result = null;
         StringBuffer retStr = new StringBuffer("");
         BufferedReader in = new BufferedReader(new InputStreamReader(systemCmd.getInputStream()));
        while ( (result=in.readLine()) != null ) {
             if(retStr.toString().equals(""))
                  retStr.append(result);
             else
                 retStr.append("|" + result);
        }
          in.close();
        return retStr.toString();

    }

     /**
      * public static StringBuffer executeBigSystemCmd (String command[]) throws IOException
      * Use this method when the output is v.large or you want back StringBuffer or
      * you want the delimiter as newline instead of '|'
      *
     */
    public static StringBuffer executeBigSystemCmd (String command[]) throws IOException {
        Process systemCmd = Runtime.getRuntime().exec(command);
        return getSystemCmdResultAsStringBuffer(systemCmd);
    }

    public static StringBuffer executeBigSystemCmd (String command) throws IOException {
        Process systemCmd = Runtime.getRuntime().exec(command);
        return getSystemCmdResultAsStringBuffer(systemCmd);
    }

    private static StringBuffer getSystemCmdResultAsStringBuffer(Process systemCmd) throws IOException {
         String result = null;
         StringBuffer retStr = new StringBuffer("");
         BufferedReader in = new BufferedReader(new InputStreamReader(systemCmd.getInputStream()));
        while ( (result=in.readLine()) != null ) {
               retStr.append(result+"\n");
        }
          in.close();
        return retStr;
    }

   /* public String getTest()
   {
        return this.m_test ;
   }
    public void setTest(String test)
   {
        this.m_test = test ;
   }*/

   /*    public void setOutput(String output)
   {
        this.m_output = output ;
   }


       public String getOutput()
   {
        return this.m_output ;
   }*/


}



in your Command Bean make this as final
    public final String USER_DEFINED = "USER_DEFINED";


 public String getCommandOutput(){
          //String szcmd = "";
          //szcmd = m_szCommand;
          String szcmdoutput = "";
          try{
               szcmdoutput = executeCmd(m_szCommand);
          }catch(Exception e){
               //catch exception here since this method is invoked thru' jsp and don't
               //want to throw exception back
               szcmdoutput = "CommandBean::executeCmd - Error in Executing Cmd - " + e.getMessage();              
          }
          return szcmdoutput;
     }

********************************************************************************************************************************


check this out and see if it works....

     
0
 
hunky_shAuthor Commented:
Kiran,

Not sure what exactly u changed in structure of code.
Some things I want to know is as following,

I have 2 action's

CommandAction which forwards results to listCommand.jsp
and
CommandOutputAction which forwards results to resultCommand.jsp

Can I use have one Action class performing both functions..

Like I have only Bean CommandBean  for both the JSP's..


in struts I usually see form extends ActionForm..  where is this thing in my implementation?

Also, request.setAttribute and request.getAttribute are not exactly struts implementation..

any better way to do this?

0
 
hunky_shAuthor Commented:
Kiran,

I see your changes in my code to make it more structured.. and I will use that and will let you know if any issue comes up..

But I need my code to be more clean and close to struts implementation.. hope u understand..

I appreciate all your help..

I am just unable to understand how my implementation is good and according to struts 1.1
0
 
kiranhkCommented:
you can have 1 action class performing both the functions..
in your action class you need to have a logical if condition for checking what the request is for... whether the request is for listCommands or run commands...
something like this

public ActionForward execute(ActionMapping actionMapping,  ActionForm actionForm,  HttpServletRequest request, HttpServletResponse response) throws Exception {

String reqPath  = actionMapping().getPath();
if(reqPath.equals("listcommands"))
...do something here
else
....do something here..



Since you are using a DynaActionForm you dont need to code for it.. Struts takes care of generating the form for you...
if not then you would have to write a class which extends the ActionForm and then override the validate, reset.... methods of the ActionForm.

check out this for DynaActionForm
http://www.exadel.com/tutorial/struts/5.2/guess/strutstutorial-dynaform.html

for ActionForm check out this...
http://www.reumann.net/struts/lesson1/step6.do
0
 
hunky_shAuthor Commented:
Thanks Kiran,

I will modify my code for this also and test it out.

Do I need a CommandBean?? Is it needed?

I know it has getters and setters method.. but is it needed according struts 1.1?

As I understand,

ListCommands.jsp -- it has to get some values from database executing the query -- that is why action class is needed.. and so I have actionmapping
in my struts-config.xml with command.do -- actionmapped to CommandAction class and this action class forwards results to listCommands.jsp  right??

Right??

Now first  -- where is controller here??

If I don't want to create this mapping of command.do etc..

I just want that somebody goes to URL  -- http://............./ListCommands.jsp and results should appear -- how can I make this??

With my above implementation -- can I directly go to URL http://............./ListCommands.jsp ??  or do I always need to go to
http://................./command.do which will forward the results to http://............./ListCommands.jsp ?



0
 
kiranhkCommented:
you cannot directly get the results in ListCommands.jsp unless you put a jsp:forward to the action  to retrieve the list of commands...
you still need to have 2 seperate action mappings in struts-config.xml...

also you need commandbean, it is needed for your action class to execute the commands the user selects.....
0
 
hunky_shAuthor Commented:
Kiran,

Thanks,

as I am reading about struts, I see there is always a controller servlet which controls the action mapping.. which one is controller servlet
in my implementation?
0
 
kiranhkCommented:
Controller Servlet is the ActionServlet in the Struts.jar... you dont need to bother abt it.. you usually create only the ActionClass and the ActionForms...
only in some rare cases you need to extend ActionServlet to do some custom processing....

check out this for ideas for extending the Struts

http://www.onjava.com/pub/a/onjava/2004/11/10/ExtendingStruts.html
0
 
hunky_shAuthor Commented:
request.setAttribute and request.getAttribute are not exactly struts implementation..

any better to do this?
0
 
kiranhkCommented:
no.. using request.set/get attribute is legal in Struts..
otherwise as i said before you need to have a Action form defined and set this as a variable for the form and use it in the jsp.. again struts will use the same request.set/get attributes for this...
0
 
hunky_shAuthor Commented:
okay got it!!

While working on it, I am splitting my page of commands and results in frameset.

So basically in struts-config.xml,

I will have another mapping now

<action path="/adminLogs"
           type="com.citi.soft.struts.action.commands.AdminLogsCommandsAction"
           name="adminLogsBean">
           forward name="success" path="/jsp/adminLogs.jsp"/>

 <action path="/command"  forward  path="/jsp/admin/dev/listCommands.jsp"/>
           
Please note that AdminLogsCommandsAction will be same as CommandAction...

adminLogsBean will be same as cBean (CommandBean)

and adminLogs.jsp will be as below:

<html>

<head>
<title>Command page</title>
</head>
 <frameset rows="200,*">
    <frame NAME="commands" SRC="command.do">
    <frameset cols="50%,50%">
          <frame NAME="results1" SRC="blank.html">
          <frame NAME="results2" SRC="blank.html">
    </frameset>
 
  </frameset>

</html>

and listCommands.jsp will have a dropdown select box -- coming from AdminLogsCommandsAction and a
parameter to refresh the page (in how many mins/secs)


will it work?

now adminLogs.jsp is associated with AdminLogsCommandsAction but actual results are going to listCommands.jsp --
will not it be  a problem?

also,
adminLogs.jsp as below has reference to command.do   -- I know this is work.. but is this the right way to do it?
<html>

<head>
<title>Command page</title>
</head>
 <frameset rows="200,*">
    <frame NAME="commands" SRC="command.do">
    <frameset cols="50%,50%">
          <frame NAME="results1" SRC="blank.html">
          <frame NAME="results2" SRC="blank.html">
    </frameset>
 
  </frameset>

</html>


0
 
kiranhkCommented:
i dont think they will be using Frames in the application....
they must be using Tiles ..... just check it out...
0
 
hunky_shAuthor Commented:
oh and

if somebody tries to go directly to URL as below

http://............../jsp/admin/dev/listCommands.jsp

it will throw an error right? how shud i avoid them going to this page.. or what do you usually do if somebody tried to directly goes to jsp instead of *.do file..

any redirect i need to do??

also,

in case of any failure -- what should i do -- should I prepare another jsp page (error.jsp) and map it to failure -- error.jsp??

how should i display the error?
error can be anywhere -- where shud i get error from?
0
 
hunky_shAuthor Commented:
oh well,

you are right -- they are using tiles -- i am not sure what it is -- but account person sitting here told me..

can u tell me how to implement this thing in tiles then what i am trying to accomplish..

sorry to bother you with all this.. i'm almost close to solution -- but i have to give them right and clean approach
0
 
kiranhkCommented:
Hiding the JSPs is easy. Put them under the WEB-INF directory. so pages can't be accessed directly- url is always hidden and only server side forwards are used,
redirection to pages is not used. Application is more consisten, because there is no direct access to wiew or form pages- controller components are accessd first *.do sevlets
 so data validation and initialization is always guaranteed. This approach is even more secure.


 <security-constraint>
<display-name>Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>SomeWebResource</web-resource-name>
<url-pattern>*.do</url-pattern>
<http-method>POST</http-method>
</web-resource-collection>
</security-constraint>

also you need to have this entry here


http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_20740042.html
http://theserverside.com/discussions/thread.tss?thread_id=20010


also for the tile part there will be tiles-definition.xml you can check that out


0
 
hunky_shAuthor Commented:
well, kiran, looks like they are not using tiles.. else there would have been tiles-definition.xml already.. but i could not find it anywhere..
may be there is no tiles being used here.. I am still checking anyway

in that case, is my frame solution above looks okay?

I have reference to command.do in my frame file adminLogs.jsp  -- is that correct way to do it?
0
 
hunky_shAuthor Commented:
oh and can u pls suggest something about error page?
0
 
kiranhkCommented:
if you dont already have a error.jsp you need to create one and then map it to failure in your action mapping..

After looking at your web.xml it seems you are using Struts Templates which is the old version..The new version with improved features is Tiles..
you must be having a jsp with <template:insert tags in them, just search for them and that will be your template jsp..
also check out this for more info on Templates
http://www.onjava.com/pub/a/onjava/2002/11/20/templatestruts.html
0
 
hunky_shAuthor Commented:
Yes I got some jsp's using template:insert tag ---

so you mean i can use same templates for atleast header,footer etc..

but how shud i split the page in frames using this approach..

I have to split page in 2 parts -- top one will have submit button -- and bottom one will display the results..

For example -- below is one jsp i got

<%@ taglib uri='template.tld' prefix='template' %>

<template:insert template='/jsp/templates/gbl_admin.jsp'>

<template:put name='title' content='&nbsp;&nbsp;Add Users&nbsp;&nbsp;' direct="true" />

<template:put name='top' content='/jsp/html/adminHeader.htm' />

<template:put name='subtoolbar' content='/jsp/admin/toolbar_in.jsp' />

<template:put name='middle' content='/jsp/admin/addUsers.jsp' />

<template:put name='footer' content='/jsp/html/footer.htm'/>

</template:insert>


Now how shud i use this example for my case
0
 
kiranhkCommented:
you subtoolbar can have your submit button jsp and your middle can have your results jsp as an example with the template above...
try it out and see if that is what your UI look and feel is
0
 
hunky_shAuthor Commented:
I am sorry, I have not understood above comment..
can u pls give me sampple code
0
 
kiranhkCommented:
<%@ taglib uri='template.tld' prefix='template' %>

<template:insert template='/jsp/templates/gbl_admin.jsp'>

<template:put name='title' content='&nbsp;&nbsp;Add Users&nbsp;&nbsp;' direct="true" />

<template:put name='top' content='/jsp/html/adminHeader.htm' />

<template:put name='subtoolbar' content='/jsp/admin/your_submitbutton.jsp' />

<template:put name='middle' content='/jsp/admin/yourresults.jsp' />

<template:put name='footer' content='/jsp/html/footer.htm'/>

</template:insert>
0
 
hunky_shAuthor Commented:
ok I did as below.

in adminLogs.jsp
I have

<%@ taglib uri='template.tld' prefix='template' %>

<template:insert template='/jsp/templates/gbl_admin.jsp'>

<template:put name='title' content='&nbsp;&nbsp;CommandScreennbsp;&nbsp;' direct="true" />

<template:put name='subtoolbar' content='/jsp/admin/dev/listCommands.jsp' />

<template:put name='middle' content='/jsp/admin/dev/outputLogs.jsp' />

</template:insert>

listCommands.jsp -- is with submit button
outputLogs.jsp -- is to display the output

I got error as below

javax.servlet.jsp.JspException: Cannot find bean under name UniqueKeyName


(This is a collection used in listCommands.jsp)...
0
 
hunky_shAuthor Commented:
I copied/pasted ur stuff also.. same error
0
 
kiranhkCommented:
as i said before you need to call your Action to set the command list attributes as UniqueKeyName and then forward to this jsp with the templates..
if you have a link for this then that link can call the action class and forward it to this jsp..
0
 
hunky_shAuthor Commented:
Ok, my stupidity..

i did

<%@ taglib uri='template.tld' prefix='template' %>

<template:insert template='/jsp/templates/gbl_admin.jsp'>

<template:put name='title' content='&nbsp;&nbsp;Soft$ Command Screen&nbsp;&nbsp;' direct="true" />

<template:put name='subtoolbar' content='isoft/iSoft/listCommands.do' />



<template:put name='footer' content='/jsp/html/footer.htm'/>

</template:insert>

it seems to be working..

but it didn't bring my submit button (listCommands.do) page... any ideas ??

I see in log -- action is also not bring invoked..


0
 
hunky_shAuthor Commented:
my action does have UniqueKeyName in it..

everything is working if I use my jsp as



<html>

<head>
<title>Command page</title>
</head>
 <frameset rows="25%,75%">
    <frame NAME="input" SRC="isoft/iSoft/listCommands.do">
    <frameset cols="50%,50%">
          <frame NAME="results1" SRC="blank.html">
          <frame NAME="results2" SRC="blank.html">
    </frameset>
 
  </frameset>


it is not working only when I am trying to use templates..

anything I am doing wrong in my "ACTION" class?? I am sorry if I am misunderstanding anything here
0
 
kiranhkCommented:
template does not call your Action if you use template insert.. so you need to call it seperately and then forward it to this template jsp........
0
 
hunky_shAuthor Commented:
oK, GOT IT..

so i did as below

I call listCommands.do from my URL..

and it invokes the action and then forward to template adminLogs.jsp as below:


<%@ taglib uri='template.tld' prefix='template' %>

<template:insert template='/jsp/templates/gbl_admin.jsp'>

<template:put name='title' content='&nbsp;&nbsp;Soft$ Command Screen&nbsp;&nbsp;' direct="true" />

<template:put name='subtoolbar' content='/jsp/admin/dev/listCommands.jsp' />

<template:put name='middle' content='/jsp/admin/dev/outputLogs.jsp' />

<template:put name='footer' content='/jsp/html/footer.htm'/>

</template:insert>

ListCommands.jsp (subtoolbar) is working fine..

submit button in listcommand calls action to outputLogs.do

which again invokes action and should bring result to middle part of the page -- (also, please note that contents of middle page has refresh flag

<META HTTP-EQUIV='Refresh' CONTENT='"+refreshParam+";'>"

now how can i make this as part of template?

0
 
hunky_shAuthor Commented:
BTW,

Initially outputlogs.jsp shud come up as blank page and then on click on submit button on subtoolbar (submit button)
it shud bring the results on middle template -- and this middle template shud have refresh parameter
(refresh parameter is field that user can select on subtoolbar page)
0
 
kiranhkCommented:
you dont need to make it as part of the template...
since when the user submits the button it will call the action and the action after processign will forward the request to adminLogs.jsp which will display the results...
so you dont need the meta refresh, this is not a frame ...
0
 
hunky_shAuthor Commented:
just so you know

below is my outputLogs.jsp  -- not working though..


<%@ taglib uri='struts/bean-el' prefix='bean' %>
<%@ taglib uri='struts/html' prefix='html' %>
<%@ taglib uri='struts/logic-el' prefix='logic' %>
<%@ taglib uri='jstl/c' prefix='c' %>
<%@ taglib uri="struts/bean" prefix="bean" %>
<%@ taglib uri="struts/logic" prefix="logic" %>
<%@ taglib uri="struts/bean" prefix="bean" %>
<%@ taglib uri="struts/html-el" prefix="html" %>
<%@ taglib uri='jstl/fmt' prefix='fmt' %>

<%
Object obj = request.getAttribute("REFRESHPARAM");
out.println("obj is " + obj);
if(obj !=null)
 String refreshParam = request.getAttribute("REFRESHPARAM").toString();
%>

<html><head>


<%  
   if (refreshParam != null) {
    if(!"0".equals(refreshParam))
     out.println("<META HTTP-EQUIV='Refresh' CONTENT='"+refreshParam+";'>");
    }
   
 %>

</head><body bgcolor='#FFFFFF'>
<pre>
<div align='left'>

         
<%
   Object o = request.getAttribute("OUTPUTLOGS");
   if(o !=null) {
    String outputLogs = o.toString();
    if(outputLogs != null)
     out.println(outputLogs);
    }
%>

</body>
</head>
</html>

0
 
kiranhkCommented:
ok.. just put a logic:present tag outside for the results in the results jsp.. if the results are present then it will display the results else nothing.
check out this

<logic:present name="your results put in the request/session attribute" scope="request/session">
show your content heree
 </logic:present >

http://struts.apache.org/userGuide/struts-logic.html

http://husted.com/struts/FAQ/view-logic.htm
0
 
kiranhkCommented:
<%@ taglib uri='struts/bean-el' prefix='bean' %>
<%@ taglib uri='struts/html' prefix='html' %>
<%@ taglib uri='struts/logic-el' prefix='logic' %>
<%@ taglib uri='jstl/c' prefix='c' %>
<%@ taglib uri="struts/bean" prefix="bean" %>
<%@ taglib uri="struts/logic" prefix="logic" %>
<%@ taglib uri="struts/bean" prefix="bean" %>
<%@ taglib uri="struts/html-el" prefix="html" %>
<%@ taglib uri='jstl/fmt' prefix='fmt' %>

<%
 String refreshParam = (String)request.getAttribute("REFRESHPARAM");
%>

<%  
   if (refreshParam != null || !("0".equals(refreshParam))) {
     out.println("<META HTTP-EQUIV='Refresh' CONTENT='"+refreshParam+";'>");
    }
   
 %>

</head><body bgcolor='#FFFFFF'>
<pre>
<div align='left'>

<logic:present name="OUTPUTLOGS" scope="request">        
<%
    String outputLogs = (String)request.getAttribute("OUTPUTLOGS");
    out.println(outputLogs);
%>
</logic:present>

</body>
0
 
hunky_shAuthor Commented:
Kiran,

with respect to refresh parameter -- i did't understand --

the page is divided into 2 parts for example --

subfooter -- with submit button
middle - with results

in subfooter -- I have a field for setting refresh parameter (20 sec, 30 sec etc... watever user choses)

based on this -- only middle frame should be refreshed -- again and again..

how do you suggest to do it?
0
 
kiranhkCommented:
ok, you can have it as the same as has been given in the code.. i got it differently earlier... :)
0
 
hunky_shAuthor Commented:
Ok Got your above comment kiran.. trying it now..

also facing one more problem..

when I click on submit button on subtoolbar -- it brings the result but it refreshes the page -- and loses all
the templates -- and just bring the results of submit button -- without templates we used on first screen..

I thought this is happening because on action of submit button -- i call /outputLogs

and in my struts-config.xml..

i have
<action path="/listCommands"
          type="com.citi.soft.struts.action.commands.AdminLogsAction"
          name="AdminLogsBean"      >
             <forward name="success" path="/jsp/adminLogs.jsp"/>
      </action>
      
      <action path="/outputLog"
          type="com.citi.soft.struts.action.commands.AdminLogsAction"
          name="AdminLogsBean"      >
             <forward name="success" path="/jsp/admin/dev/outputLogs.jsp"/>
      </action>

and thus outputLog -- forwards the page to a new jsp and thus --

so I tried

<forward name="success" path="/jsp/adminLogs.jsp"/>
in my

<action path="/outputLog"

but then it loses the UniqueKeyName collection object -- because UniqueKeyName collection is only there when

path is listCommands..

what shud i do in this case
0
 
hunky_shAuthor Commented:
My new Action class for your refrerence

public ActionForward execute(ActionMapping actionMapping,
                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {

          System.out.println("in AdminLogsAction execute");
          
          String reqPath  = actionMapping.getPath();
          System.out.println("Got reqPath: " + reqPath);
        if(reqPath.equals("/listCommands")) {
          Connection conn = null;
                String keyName;
                String keyValue;
                ArrayList UniqueKeyName = new ArrayList();
               
       
        try
            {
                conn = ServiceLocator.getInstance().getDataSource(com.citi.soft.common.sql.DataSourceName.SOFTDLR.getName()).getConnection();
              Statement stmt = conn.createStatement();
                String sql = "select * from iSoftKeyValueTb";
               
             
                  ResultSet rs = stmt.executeQuery(sql);

                  while(rs.next()){
                        keyName = rs.getString("keyname").trim();
                        keyValue = rs.getString("keyvalue").trim();
                        System.out.println("KeyName is : " + keyName + " and value is : " + keyValue);
                        //m_lrec.add(MsgType.GEN, keyName);
                        ReferenceBean myref2 = new ReferenceBean();
                        myref2.setCode(keyValue);
                        myref2.setCodeDesc(keyName);
                        UniqueKeyName.add(myref2);
                  }
                  request.setAttribute("UniqueKeyName",UniqueKeyName);

      } catch(SQLException sqlEx) {
                  System.out.println("Exception is : "+ sqlEx);
                  sqlEx.printStackTrace();            
                  ActionErrors errors = new ActionErrors();
                  ActionError error1 = new ActionError("errors.submitreport.report.error.sql");
                           errors.add( ActionErrors.GLOBAL_ERROR, error1 );
                  saveErrors( request, errors );
                  return actionMapping.findForward("failure");
            }
            finally {
                  try
                  {
                        conn.close();            
                  }
                  catch (SQLException ignored)
                  {
                  }
        }
         
        return actionMapping.findForward("success");
                 
      }
       else {
          System.out.println("in else");
         
          DynaActionForm dform = (DynaActionForm)actionForm ;
          AdminLogsBean aBean = new AdminLogsBean();
              BeanUtils.copyProperties(aBean, dform );

            String commandParam = aBean.getCommandParam();
            System.out.println("commandParam  is : " + commandParam);

            String refreshParam = aBean.getRefreshParam();
            System.out.println("refreshParam = " + refreshParam);
            
            request.setAttribute("REFRESHPARAM", refreshParam);
        aBean.setCommand(commandParam);

          
          String output = aBean.getCommandOutput();
          request.setAttribute("OUTPUTLOGS", output);
          
          
          /*
          System.out.println("output is : " + output);
          aBean.setOutput(output);
          request.setAttribute("OUTPUT", output);
        */
       
          /*
        String outputLogs="";
          
          outputLogs+= "<html><head>";
          if(refreshParam != 0)
         outputLogs+= " <META HTTP-EQUIV='Refresh' CONTENT='"+refreshParam+";'>";
         outputLogs+= " </head><body bgcolor='#FFFFFF'>";
         outputLogs+= " <pre>" ;
         outputLogs+= " <div align='left'>";

         
         request.setAttribute("OUTPUT", outputLogs);
      */
         
          return actionMapping.findForward("success");
0
 
kiranhkCommented:
yes.. so you need to put your UniqueKeyName in the session instead of Request in your action class
use
request.getSession().setAttribute("UniqueKeyName", your list of commands);

0
 
kiranhkCommented:
request.setAttribute("UniqueKeyName",UniqueKeyName);
change this to
request.getSession().setAttribute("UniqueKeyName", UniqueKeyName);
0
 
hunky_shAuthor Commented:
and you mean --

in my struts-config.xml,

for my action = /outputLog

i should again forward to adminLogs.jsp (template jsp) Right?

if you say Yes to above,

would not refreshparam will keep refreshing the whole page --

i just need to refresh the middle template -- not the whole page
0
 
kiranhkCommented:
yes..

 
>>>would not refreshparam will keep refreshing the whole page --
yes, it will refresh the whole page.. when you use Templates/Tiles the whole page is refreshed..
if you dont want that to happen then you need to use frames. There is no option for refreshing only part of your page...
0
 
hunky_shAuthor Commented:
Oh well,

ok it is refreshing the whole page in this case as expected.. but this will not work..
because if user choses refreshParam as 1 sec.. it refreshes so fast that it is not easy to change the value
of refreshParam after that..

also..

templates is working great..

only thing is ..

my frameset was as below

<html>

<head>
<title>Command page</title>
</head>
 <frameset rows="25%,75%">
    <frame NAME="input" SRC="isoft/iSoft/listCommands.do">
    <frameset cols="50%,50%">
          <frame NAME="results1" SRC="blank.html">
          <frame NAME="results2" SRC="blank.html">
    </frameset>
 
  </frameset>

</html>

so basically I have 2 splits in middle frame..

any easy to deal with this?
0
 
kiranhkCommented:
what is results1 an results2...
0
 
hunky_shAuthor Commented:
Ok about refreshParam thing..

so only solution is back to frames -- no other clean approach to accomplish this since I thought we are almost
in end using templates and all..

any design you can suggest which is better than this..

0
 
kiranhkCommented:
as i said before you cannot refresh part of a web page using Templates/Tiles.. so best thing would be is to use Frames..
0
 
hunky_shAuthor Commented:
in listCommands.jsp,

I have 2 set of commands  list box -- 2 forms -- 2 submit form  

(left part -- have one form)  (right part -- has another form)

both form's are exactly same..


left commandbox -- display results in result1 frame
right commandbox -- display results in results2 frame..


it is just so that users can see 2 files at same time .. in left frame and right frame --

as well as they have automatic refresh of page also for this.. for each frame
0
 
hunky_shAuthor Commented:
Ok, I am putting frames back then..

i can still use templates right?? for header etc..

this is what i did

in my adminLogs.jsp

<%@ taglib uri='template.tld' prefix='template' %>

<template:insert template='/jsp/templates/gbl_admin.jsp'>

<template:put name='title' content='&nbsp;&nbsp;Soft$ Command Screen&nbsp;&nbsp;' direct="true" />

<template:put name='subtoolbar' content='/jsp/admin/dev/listCommands.jsp' />

<template:put name='middle' content='/jsp/admin/dev/outputLogsFrame.jsp' />

<template:put name='footer' content='/jsp/html/footer.htm'/>

</template:insert>

and my

outputLogsFrame.jsp

looks as below


<html>

<head>
<title>Command page</title>
</head>
    <frameset cols="50%,50%">
          <frame NAME="results1" SRC="outputLogs.jsp">
          <frame NAME="results2" SRC="outputLogs.jsp">
    </frameset>
 
  </frameset>

</html>

and my struts-config.xml

on click of submit --

just forwards results to
adminLogs.jsp

but this is not working..

should listCommand.jsp be part of this framset??

can u suggest something to make it work pls
0
 
hunky_shAuthor Commented:
Ok, I did this

I have another file here

adminLogsFrame.jsp


<html>

<head>
<title>Command page</title>
</head>
 <frameset rows="25%,75%">
    <frame NAME="input" SRC="adminLogsTop.jsp">
    <frameset cols="50%,50%">
          <frame NAME="results1" SRC="adminLogsMiddle.jsp">
          <frame NAME="results2" SRC="adminLogsMiddle.jsp">
    </frameset>
 
  </frameset>

</html>

and in adminLogsTop.jsp

<%@ taglib uri='template.tld' prefix='template' %>

<template:insert template='/jsp/templates/gbl_admin.jsp'>

<template:put name='title' content='&nbsp;&nbsp;Soft$ Command Screen&nbsp;&nbsp;' direct="true" />
<template:put name='subtoolbar' content='/isoft/iSoft/listCommands.do' />

</template:insert>

and in adminLogsMiddle.jsp

<%@ taglib uri='template.tld' prefix='template' %>

<template:insert template='/jsp/templates/gbl_admin.jsp'>


<template:put name='middle' content='/jsp/admin/dev/outputLogs.jsp' />

</template:insert>

and now i am trying to hit URL using

http://......./adminLogsFrame.jsp

do u think it will work..

it is not working .. any ideas what am i doing wrong

0
 
kiranhkCommented:
now what error r u getting...
0
 
hunky_shAuthor Commented:
Kiran,

I will close this Q, since you have already helped me alot on this question and I have kinf of functional solution with few errors..

I am opening another Q, in which i will tell how I implment, and you or other experts can please help me making my implementation better as well as fixing some issues which I am having..

Thanks and Regards
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 38
  • 29
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now