package binary.solutions; import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.action.*;
public final class BinaryAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HitModel hm = new HitModel(); hm.incrementHit(); request.setAttribute(Constants.HIT_KEY, hm); //forward control to the specied URI return (mapping.findForward("Welcome")); } } package binary.solutions; import java.sql.*; public final class HitModel { private Connection conn; public HitModel() { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); conn = DriverManager.getConnection ("jdbc:mysql://localhost/hittable"); } catch(Exception exception) { } }public synchronized void incrementHit() { try { Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM HITTABLE"); rs.next(); int hitCounter = rs.getInt("HIT"); stmt.executeQuery("UPDATE HITTABLE SET HIT =" + String.valueOf(hitCounter)); } catch(Exception e) { e.printStackTrace(); } } } Jarnot Voytek Contr AU HQ/SC To: "'Struts Users Mailing List'" <Voytek.Jarnot@MAXW <[EMAIL PROTECTED]> ELL.AF.MIL> cc: Subject: RE: Can anyone help me out with this 02/04/2003 12:15 PM Please respond to "Struts Users Mailing List" what does binary.solutions.BinaryAction do? post the code. -- Voytek Jarnot Quidquid latine dictum sit, altum viditur. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 04, 2003 11:08 AM > To: Struts Users Mailing List > Subject: Can anyone help me out with this > > > > This is driving me crazy. Originally in my index.jsp I had > <logic:forward > name="welcome"/> > and the page was never forwarded to welcome.do. I changed my tag to > <logic:redirect name="welcome"/> > and the page was sent to welcome.do, but the page was blank. > In my console > window I get > the message RequestProcessor-Processing a GET for path /welcome and no > other errors. > If I try the same web app in Netscape I get an error window with the > message "The document contained no data" What am I missing or > doing wrong? > > > <struts-config> > <!-- =================================== Global Forward > Definitions --> > > <global-forwards> > <forward > name="welcome" > path="/welcome.do"/> > </global-forwards> > > <!-- =================================== Action Mapping > Definitions --> > > <action-mappings> > <action > path="/welcome" > type="binary.solutions.BinaryAction"/> > </action-mappings> > > </struts-config> > -------------------------------------------------------------- > ------------------------------------------------- > > > > > <%@ taglib uri="/tags/struts-logic" prefix="logic" %> > <logic:forward name="welcome"/> > > <%-- > > Redirect default requests to Welcome action. > > --%> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > ************************************************************** > ************************************************************** > ************************************************************* > > This message is intended for the use of the individual or > entity to which > it is addressed and may contain information that is confidential and > privileged and exempt from disclosure under applicable law. > If the reader > of this message is not the intended recipient, you are hereby > notified that > any dissemination, distribution, or copying of this communication is > strictly prohibited. If you have received this communication > in error, > please contact the sender immediately and delete it from your system. > Thank you > ************************************************************** > ************************************************************** > ************************************************************* > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ***************************************************************************************************************************************************************************************** This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential and privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank you ***************************************************************************************************************************************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]