File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts tags are not working fine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts tags are not working fine" Watch "Struts tags are not working fine" New topic
Author

Struts tags are not working fine

atul shinde
Greenhorn

Joined: Oct 31, 2008
Posts: 4
Hi,

I am using the Struts 1.3.8 with Eclipse and JBoss server. I have added all struts lib files in WEB-INF/lib directory. Well, all lib files are getting properly but when i am using the struts tags in jsp, are not getting displayed properly. for example : when i use the <html:select> tag, all values are displaying like the values in readonly textarea.

I have paste some values below :

---- Select ---- ABFS ABM ACF ACTON ADOPT ADV AG AGF AHF AJSB ALARM AMC AMER AMI AMIC AMS AMSO ANB ANC ANMC AQ ARMC ARTER ASB ASF ASFL ASHE AVCO BAIL BAM BEF BEN BEN/MET BEN/SE BEN/TO BFB DEMO BFS BHS BIS BISYS BLAZER BLOOM BLUE BM BNM BO BOA BOB BOG BOA/WA BOWEN BRG BROWN BRUCE .....

Also the problem with <html:text> and <html:submit> tag, these controls are not display in jsp page.

Can somebody help me?
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
Post the tags from your jsp please so we can look at them.
atul shinde
Greenhorn

Joined: Oct 31, 2008
Posts: 4
Originally posted by Tom Rispoli:
Post the tags from your jsp please so we can look at them.


It seems to be ok now. Getting different error now.

Tag lib declaration from jsp file :

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="bean" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>


Tag lib declaration in web.xml file :
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
</jsp-config>




Now the error which I am getting is :

org.apache.jasper.JasperException: /UpdateNOIInfo.jsp(99,11) No tag "messagesPresent" defined in tag library imported with prefix "logic"
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:200)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1308)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1560)
at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1789)
at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1060)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1367)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1560)
at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
at org.FMLaw.Servlet.AbstractFMLawController.dispatch(AbstractFMLawController.java:160)
at org.FMLaw.Servlet.UpdateNOIController.handleRequest(UpdateNOIController.java:44)
at org.FMLaw.Servlet.AbstractFMLawController.doPost(AbstractFMLawController.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.FMLaw.Servlet.AbstractFMLawController.service(AbstractFMLawController.java:72)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:619)



This is what the stack trace shows. Same is case with following tags :


<logic:messagesPresent message="true">
<TR>
<html:messages id="message" message="true">
<TD colspan="5" class="gray_row_bg_dark" align="center">
<bean:write name="message"/>
</TD>
</html:messages>
</TR>
</logic:messagesPresent>


Please help.
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
Looks like you are using the logic prefix to reference the bean tab library:

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="logic" %>

You probably want it to point to the logic tag library, like this:

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
atul shinde
Greenhorn

Joined: Oct 31, 2008
Posts: 4

[ November 04, 2008: Message edited by: atul shinde ]
atul shinde
Greenhorn

Joined: Oct 31, 2008
Posts: 4
Thanks for showing the mistake. I will try this and get back to you in case of any problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts tags are not working fine
 
Similar Threads
"WEB-INF/lib/struts-html.tld" not Found
Not able to use Struts Taglibs
Problem in pager tab lib
Error: The requested resource /webapplication_name/ is not available
Getting error while invoking JSP page having Tag Libraries on Websphere Application Server 6.1