You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Paradis, André" <an...@versalys.com> on 2001/08/17 14:57:45 UTC
RE: and Javascript; Templates
Hi Juraz,
You can get the struts code and add support for missing javascript
attributes in html:img tag code, or copy and modify the code in a new
file
and modify the tld so it uses your tag class instead of the default one.
Andre
-----Original Message-----
From: Juraj Kazda [mailto:jkazda@infobase.sk]
Sent: August 17, 2001 2:51 AM
To: STRUTS-USER (el. adresa)
Subject: [Q]: <html:img.../> and Javascript; Templates
Hello friends,
I have a two problems: one with templates, and another (still) with
internationalization, resp. with <html:img .../> tag.
First <html:img .../> tag:
Is it possible to have struts render the HTML <img ...> tag _with_
support for _all_ Javascript event listeners? I need to make rollovers
with my navigation bar. However, I need to have my application
internationalized too. With struts' <html:img .../> tag I can achieve
internationalization in a very simple and convenient way (thank you for
that advice :-)), but I can't use onMouseOver and onMouseOut event
listeners in that tag. While using HTML <img ...> tag, I have no problem
with Javascript, but there is a problem with staying international...
How to break this ring?
Second templates:
I've defined very small template framework (all the sources follows) and
after running it, all files in the template which are JSP are not
rendered/processed as JSP (it's just copied source to the output) . Can
someone take a look at these very simple sources and tell me what's
wrong? I think I'm missing something very basic, but I can't find
what...
-------------------- BEGIN : index.jsp ----------------------------
<%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %>
<template:insert template='/indexTemplate.jsp'>
<template:put name='header' content='/header.html' />
<template:put name='content' content='/content.jsp'/>
<template:put name='footer' content='/footer.html' />
</template:insert>
-------------------- END : index.jsp ------------------------------
-------------------- BEGIN : indexTemplate.jsp --------------------
<%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Confer title</title>
</head>
<body>
<template:get name="header"/>
<template:get name="content"/>
<template:get name="footer"/>
</body>
</html>
-------------------- END : indexTemplate.jsp -----------------------
-------------------- BEGIN : header.html --------------------------
-> HEADER
<hr>
-------------------- END : header.html ----------------------------
-------------------- BEGIN : content.jsp --------------------------
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="html" %>
<h1><bean:message key="welcome.message"/></h1>
-------------------- END : content.jsp ----------------------------
-------------------- BEGIN : footer.html --------------------------
<hr>
-> FOOTER
-------------------- END : footer.html ----------------------------
That part regarding content.jsp is not processed. There is shown
nothing. The source from browser follows:
-------------------- BEGIN : result in browser --------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Confer title</title>
</head>
<body>
-> HEADER
<hr>
<h1><bean:message key="welcome.message"/></h1>
<hr>
-> FOOTER
</body>
</html>
--------------------- END : result in browser ----------------------
I really don't know why it doesn't work. My configuration:
- Resin 2.0.1 (application created in webapps/confer)
- directory struture:
%RESIN_HOME%/webapps/confer/index.jsp
%RESIN_HOME%/webapps/confer/indexTemplate.jsp
%RESIN_HOME%/webapps/confer/header.html
%RESIN_HOME%/webapps/confer/content.jsp
%RESIN_HOME%/webapps/confer/footer.html
%RESIN_HOME%/webapps/confer/WEB-INF/struts-bean.tld
%RESIN_HOME%/webapps/confer/WEB-INF/struts-html.tld
%RESIN_HOME%/webapps/confer/WEB-INF/struts-template.tld
%RESIN_HOME%/webapps/confer/WEB-INF/struts-config.xml
%RESIN_HOME%/webapps/confer/WEB-INF/web.xml
%RESIN_HOME%/webapps/confer/WEB-INF/classes/org/res/confer.properties
%RESIN_HOME%/webapps/confer/WEB-INF/lib/struts.jar
- Struts 1.0-b1
- Internet Explorer 5.5 under W2k Prof.
- configs:
-------------------- BEGIN : struts-config.xml --------------------
<?xml version="1.0" encoding="windows-1250"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD
Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
</struts-config>
-------------------- END : struts-config.xml ----------------------
-------------------- BEGIN : web.xml ------------------------------
<?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>
<classpath id="/WEB-INF/classes"/>
<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/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>application</param-name>
<param-value>org.res.confer</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<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-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
</web-app>
-------------------- END : web.xml --------------------------------
-------------------- BEGIN : confer.properties --------------------
welcome.message=Hello, friend!
-------------------- END : confer.properties ----------------------
Thank you for your help and have a nice day.
With regards
--jerryk
Re[2]: and Javascript; Templates
Posted by Anthony Xin Chen <xi...@tbcommerce.com>.
Hello André,
Actually img tag extends from BaseHandler tag which supports
onmouseover and onmouseout js listener. So you can use those directly.
--
Best Regards!
Anthony Xin Chen
PA> -----Original Message-----
PA> From: Juraj Kazda [mailto:jkazda@infobase.sk]
PA> Sent: August 17, 2001 2:51 AM
PA> To: STRUTS-USER (el. adresa)
PA> Subject: [Q]: <html:img.../> and Javascript; Templates
PA> Hello friends,
PA> I have a two problems: one with templates, and another (still) with
PA> internationalization, resp. with <html:img .../> tag.
PA> First <html:img .../> tag:
PA> Is it possible to have struts render the HTML <img ...> tag _with_
PA> support for _all_ Javascript event listeners? I need to make rollovers
PA> with my navigation bar. However, I need to have my application
PA> internationalized too. With struts' <html:img .../> tag I can achieve
PA> internationalization in a very simple and convenient way (thank you for
PA> that advice :-)), but I can't use onMouseOver and onMouseOut event
PA> listeners in that tag. While using HTML <img ...> tag, I have no problem
PA> with Javascript, but there is a problem with staying international...
PA> How to break this ring?