Gabriela Hinojosa

Greenhorn
+ Follow
since Sep 05, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Gabriela Hinojosa

This is the action:

private ActionForward performeEdit(String myaction,
ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response) {
try {

System.out.println("[performeDel] actionForm: " + actionForm);
FormBeanInputListado form = (FormBeanInputListado) actionForm;

System.out.println(" [performeDel] Instancia el DAO ");
ControlDAO controlDAO = new ControlDAO();

String buscar = null;
int cod = 0;

if(form != null){
cod = form.getTelcgid();
System.out.println("[performeDel] cod: " + cod);
}

if(cod != 0){
buscar = "WHERE TELCGID = " + cod ;
System.out.println("buscar: " + buscar );
}

List list = controlDAO.search(buscar, request);
System.out.println("listaAct.size(): " + list.size());
System.out.println(list.get(0).toString());
Directorio dic = (Directorio) list.get(0);
System.out.println(dic.getTeldsext());
request.setAttribute("listaAct", list);


}catch (Exception e) {
// e.printStackTrace();
System.out.println("e.toString(): " + e.toString());
generalError(request, e);
return mapping.findForward("fallo");
}

if (__log.isInfoEnabled()) {
__log.info(" [ControlAction] Forward: \"exito\"");
}
return mapping.findForward("exito");

}

and this is the formbean:

package directorio.controller;

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 FormBeanInput extends ActionForm {
public final static int ADD = 1;
public final static int EDIT = 2;
public final static int LIST = 3;
private int strutsAction;
private int telcgid = 0;
private String teldsext = null;
private String teldsape = null;
private String teldsnom = null;
private int telcgidgrp = 0;
private String teldsnum1 = null;
private String teldsnum2 = null;
private int teldspis = 0;
private String teldscen = null;
private String depdsnm = null;

public void reset(ActionMapping mapping, HttpServletRequest request) {

// Reset values are provided as samples only. Change as appropriate.

telcgid = 0;
teldsext = null;
teldsape = null;
teldsnom = null;
telcgidgrp = 0;
teldsnum1 = null;
teldsnum2 = null;
teldspis = 0;
teldscen = null;
depdsnm = null;

}

public int getStrutsAction() {
return strutsAction;
}

public void setStrutsAction(int strutsAction) {
this.strutsAction = strutsAction;
}

public int getTelcgid() {
return telcgid;
}

public void setTelcgid(int telcgid) {
this.telcgid = telcgid;
}

public int getTelcgidgrp() {
return telcgidgrp;
}

public void setTelcgidgrp(int telcgidgrp) {
this.telcgidgrp = telcgidgrp;
}

public String getTeldsape() {
return teldsape;
}

public void setTeldsape(String teldsape) {
this.teldsape = teldsape;
}

public String getTeldscen() {
return teldscen;
}

public void setTeldscen(String teldscen) {
this.teldscen = teldscen;
}

public String getTeldsext() {
return teldsext;
}

public void setTeldsext(String teldsext) {
this.teldsext = teldsext;
}

public String getTeldsnom() {
return teldsnom;
}

public void setTeldsnom(String teldsnom) {
this.teldsnom = teldsnom;
}

public String getTeldsnum1() {
return teldsnum1;
}

public void setTeldsnum1(String teldsnum1) {
this.teldsnum1 = teldsnum1;
}

public String getTeldsnum2() {
return teldsnum2;
}

public void setTeldsnum2(String teldsnum2) {
this.teldsnum2 = teldsnum2;
}

public int getTeldspis() {
return teldspis;
}

public void setTeldspis(int teldspis) {
this.teldspis = teldspis;
}

public String getDepdsnm() {
return depdsnm;
}

public void setDepdsnm(String depdsnm) {
this.depdsnm = depdsnm;
}

//@SuppressWarnings("deprecation")
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();

if ((teldsext == null) || (teldsext.length() == 0)) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.required"));
} else if (teldsext.length() > 5) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.toBig", "5"));
}
if ((teldsape == null) || (teldsape.length() == 0)) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.required"));
}
if ((teldsnom == null) || (teldsnom.length() == 0)) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.required"));
}
if (telcgidgrp == 0) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.required"));
}
if ((teldsnum1 == null) || (teldsnum1.length() == 0)) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.required"));
} else if (teldsnum1.length() > 11) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.toBig", "11"));
}
if ((teldsnum2 == null) || (teldsnum2.length() == 0)) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.required"));
} else if (teldsnum2.length() > 11) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.toBig", "11"));
}
if ((teldspis == 0)) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.required"));
}
if ((teldscen == null) || (teldscen.length() == 0)) {
errors.add("input", new org.apache.struts.action.ActionError(
"error.input.required"));
}
return errors;
}
}



I use another formbean for redirect the action it contains just the atribute that will pass the value to the other jsp.

Thanks for your help...
18 years ago
Please I need your help, I have a jsp with the right names and tags and my formbean has the same names but in the console I have this error:

05-sep-2006 12:20:37 org.apache.catalina.core.ApplicationDispatcher invoke
GRAVE: El Servlet.service() para servlet jsp lanz� una excepci�n
javax.servlet.jsp.JspException: No getter method for property: "teldsext" of bean: "listaAct"
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:987)
at org.apache.struts.taglib.html.BaseFieldTag.prepareValue(BaseFieldTag.java:121)
at org.apache.struts.taglib.html.BaseFieldTag.renderInputElement(BaseFieldTag.java:102)
at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:81)
at org.apache.jsp.jsp.actualizacion_jsp._jspx_meth_html_text_0(actualizacion_jsp.java:169)
at org.apache.jsp.jsp.actualizacion_jsp._jspService(actualizacion_jsp.java:106)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:988)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)

Please, help me!!!

Thanks
18 years ago