You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Rothschadl <da...@salserompls.com> on 2002/12/28 16:49:04 UTC

Still no getter method available...

I am still getting the Error Message: No getter method for property geozoneID of bean org.apache.struts.taglib.html.BEAN. 
I have tried everything.....maybe my Action class is not right, which would not surprise me, since this is my maiden voyage into the Java world. Here is the code. Any help would be greatly appreciated!
 

package tgt.transportation.points.action;

import java.io.IOException;

import java.lang.reflect.InvocationTargetException;

import java.util.Locale;

import java.util.Hashtable;

import java.util.Date;

import java.util.Vector;

import javax.servlet.ServletException;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionError;

import org.apache.struts.action.ActionErrors;

import org.apache.struts.action.ActionForm;

import org.apache.struts.action.ActionForward;

import org.apache.struts.action.ActionMapping;

 

public class GeoZoneAction extends org.apache.struts.action.Action {

// Method signature

public ActionForward perform(

         ActionMapping mapping, 

         ActionForm form,

        HttpServletRequest request,

       HttpServletResponse response)

         throws IOException, ServletException {



// Extract attributes we will need

Locale locale = getLocale(request);

MessageResources messages = getResources();

HttpSession session = request.getSession();

GeoZoneForm geoForm = (GeoZoneForm) form;

String action = request.getParameter("action");

if (action == null)

    action = "Create";

    if (servlet.getDebug() >= 1)

        servlet.log("GeoZoneAction: Processing " + action + " action");

    Hashtable database = (Hashtable)

       servlet.getServletContext().getAttribute(Constants.DATABASE_KEY);

            if (servlet.getDebug() >= 1)

                servlet.log("GeoZoneAction: Processing " + action + " action");

// Populate the GeoZone form

if (form == null) {

            if (servlet.getDebug() >= 1)

               servlet.log(" Creating new GeoZoneForm bean under key "

                                  + mapping.getAttribute());

              form = new GeoZoneForm();

                 if ("request".equals(mapping.getScope()))

                        request.setAttribute(mapping.getAttribute(), form);

               else

                        session.setAttribute(mapping.getAttribute(), form);

}



GeoZoneForm geoForm = (GeoZoneForm) form;

   if (user != null) {

                if (servlet.getDebug() >= 1)

                    servlet.log(" Populating form from " + user);

                try {

                    PropertyUtils.copyProperties(geoForm, user);

                    geoForm.setAction(action);

                    geoForm.setGeozoneID(null);

                    geoForm.setGeozoneName(null);

               } catch (InvocationTargetException e) {

                    Throwable t = e.getTargetException();

                    if (t == null)

                        t = e;

                   servlet.log("GeoZoneForm.populate", t);

                   throw new ServletException("GeoZoneForm.populate", t);

              } catch (Throwable t) {

                   servlet.log("GeoZoneForm.populate", t);

                   throw new ServletException("GeoZoneForm.populate", t);

               }

}

       // Set a transactional control token to prevent double posting

       if (servlet.getDebug() >= 1)

            servlet.log(" Setting transactional control token");

        saveToken(request);

    // Forward control to the Geographic Zone Maintenance page

         if (servlet.getDebug() >= 1)

             servlet.log(" Forwarding to 'GeoZoneMaint' page");

     return (mapping.findForward("GeoZoneMaint"));

   }

}

 

David Rothschadl

Re: logon servlet through html forms "resource not available"

Posted by Melissa L Kelley <st...@stuology.net>.
On Fri, 28 Dec 2001, Loren Hall wrote:

There isn't a lot of detail on how you have things configured, but as far
as your html form, you need to set the value of action according to the
way you mapped the action servlet. So, if you used extention mapping the
way the standard examples give:

<servlet-mapping>
     <servlet-name>action</servlet-name>
     <url-pattern>*.do</url-pattern>
</servlet-mapping>

Then your html form would need to be like so:

<form action="/summershow/logon.do" method="post" name="logon">

If you used a prefix mapping like so:

<servlet-mapping>
     <servlet-name>action</servlet-name>
     <url-pattern>/do/*</url-pattern>
</servlet-mapping>


Then your html form would need to be

<form action="/summershow/do/logon" method="post" name="logon">



> New to this and can't access /logon action through a standard html form
>
> I'm integrating some struts functionality with a pre-existing, html based
> site.  At index.html I'd like a login form, but don't want to force a change
> to index.jsp.  However, i've tried action="logon",
> action="/summershow/logon" and it says The requested resource (/logon) is
> not available. I figure it's a path issue vs. an access issue, but for all I
> know an html form just won't work.
>
>
> First, any thoughts why the following html form tag won't work, and second,
> what is the standard solution for this situation, .jsp or .html?
>
>
> <form action="/summershow/logon" method="post" name="logon">
> <input name="username" type="text">
> <input name="password" type="password">
> <input name="submit" type="submit">
> </form>
>
> responds with
>
> type: Status report
> message: /logon
> description: The requested resource (/logon) is not available.
>
>
> The servlet is under catalina/webapps/summershow/WEB-INF/ . . .  The working
> code looks like this.
>
>
> <html:form action="/logon" focus="username">
>       User Name:       <html:text property="username" size="16"
> maxlength="16"/>
> 	Password:        <html:password property="password" size="16"
> maxlength="16" redisplay="false"/>
>       <html:submit property="submit" value="Submit"/>
>       <html:reset/>
> </html:form>
>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>




--> stu: www.stuology.net
It just no longer is plain simple safe fun
when it's the psycho chimp that has the ray gun
------------------------------------------------
Stuology -- A million monkeys can't be wrong


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


logon servlet through html forms "resource not available"

Posted by Loren Hall <lo...@attbi.com>.
New to this and can't access /logon action through a standard html form

I'm integrating some struts functionality with a pre-existing, html based
site.  At index.html I'd like a login form, but don't want to force a change
to index.jsp.  However, i've tried action="logon",
action="/summershow/logon" and it says The requested resource (/logon) is
not available. I figure it's a path issue vs. an access issue, but for all I
know an html form just won't work.


First, any thoughts why the following html form tag won't work, and second,
what is the standard solution for this situation, .jsp or .html?


<form action="/summershow/logon" method="post" name="logon">
<input name="username" type="text">
<input name="password" type="password">
<input name="submit" type="submit">
</form>

responds with

type: Status report
message: /logon
description: The requested resource (/logon) is not available.


The servlet is under catalina/webapps/summershow/WEB-INF/ . . .  The working
code looks like this.


<html:form action="/logon" focus="username">
      User Name:       <html:text property="username" size="16"
maxlength="16"/>
	Password:        <html:password property="password" size="16"
maxlength="16" redisplay="false"/>
      <html:submit property="submit" value="Submit"/>
      <html:reset/>
</html:form>





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>