struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Nenning <Christoph.Nenn...@lex-com.net>
Subject Re: How can I convert .jsp to .ftl (freemarker)?
Date Fri, 23 Jun 2017 11:19:20 GMT
> From: ssmtpmailtesting ssmtpmailtesting <ssmtpmailtesting@gmail.com>
> To: user@struts.apache.org, 
> Date: 23.06.2017 10:12
> Subject: How can I convert .jsp to .ftl (freemarker)?
> 
> login.jsp =
> 
> <%@ taglib prefix="s" uri="/struts-tags"%>
> <%@ page contentType="text/html; charset=UTF-8"%>
> 
> <html>
> <head>
>     <title>Login Form</title>
> </head>
> <body>
>     <h1>Struts 2 Hello World Example</h1>
> 
>     <s:form action="Welcome" method="post">
>         <s:textfield name="username" label="Username" />
>         <s:textfield name="description" label="Description" />
>         <s:password name="password" label="Password" />
>         <s:submit />
>     </s:form>
> 
> </body>
> </html>
> 
> 
> I tried this: login.ftl =
> 
> <#assign s=JspTaglibs["struts-tags.tld"] />
> <html>
> <head>
>     <title>Login Form</title>
> </head>
> <body>
>     <h1>Struts 2 Hello World Example</h1>
> 
>     <@s:form action="Welcome" method="post">
>         <@s:textfield name="username" label="Username" />
>         <@s:textfield name="description" label="Description" />
>         <@s:password name="password" label="Password" />
>         <@s:submit />
>     </@s:form>
> 
> </body>
> </html>
> 
> But it didn't output html form.
> 
> How can I convert from .jsp to .ftl?
> 

One thing that catches my eye: in freemarker you have to replace colons 
with dots:

<@s.form action="Welcome" method="post">


HTH
Christoph


This Email was scanned by Sophos Anti Virus

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message