Re: Why do I get HTTP Status 404 - Not Found after http://localhost:8080/struts2_maven/User/Login.action?
pom.xml = http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> 4.0.0 com.training struts2_maven war 0.0.1-SNAPSHOT struts2_maven Maven Webapp http://maven.apache.org junit junit 3.8.1 test org.apache.struts struts2-core 2.5.10.1 javax.servlet javax.servlet-api 4.0.0-b01 struts2_maven In web.xml web-app_2_5.dtd and Web Application 2.3 don't work. It gets error: "Referenced file contains errors (http://java.sun.com/dtd/web-app_2_5.dtd). For more information, right click on the message in the Problems View and select "Show Details..." http://java.sun.com/dtd/web-app_2_5.dtd";> Struts 2 Web Application struts2 org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter struts2 /* 2.3 and _2_3 works in web.xml On Sun, Jun 18, 2017 at 2:11 PM, Lukasz Lenart wrote: > You are mixing two different version of Struts - 2.3.x and 2.5.x - you > must stick with one. See my comments below > > 2017-06-18 4:06 GMT+02:00 ssmtpmailtesting ssmtpmailtesting > : >> http://localhost:8080/struts2_maven/User/Login.action >> >> HTTP Status 404 - Not Found >> >> type Status report >> >> messageNot Found >> >> descriptionThe requested resource is not available. >> GlassFish Server Open Source Edition 4.0 >> >> tree . >> . >> ├── pom.xml >> ├── src >> │ ├── main >> │ │ ├── java >> │ │ │ └── com >> │ │ │ └── mkyong >> │ │ │ └── user >> │ │ │ └── action >> │ │ │ └── WelcomeUserAction.java >> │ │ ├── resources >> │ │ │ ├── struts.xml >> │ │ │ └── struts.xml~ >> │ │ └── webapp >> │ │ ├── index.jsp >> │ │ ├── struts2-core-2.5.10.1.jar > > This JAR shouldn't be here, remove it > >> │ │ ├── User >> │ │ │ └── pages >> │ │ │ ├── login.jsp >> │ │ │ └── welcome_user.jsp > > You should move all the JSP files under WEB-INF to increase security > -> http://struts.apache.org/security/#never-expose-jsp-files-directly > >> │ │ └── WEB-INF >> │ │ ├── lib >> │ │ ├── struts2-core-2.5.10.1.jar > > This JAR shouldn't be here, remove it > >> │ │ └── web.xml >> │ └── test >> │ └── java > >> struts.xml >> >> >> > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" >> "http://struts.apache.org/dtds/struts-2.0.dtd";> > > You are using an outdated DTD, please use version 2.5 (when using > Struts 2.5.10.1) or 2.3 (when using Struts 2.3.32) > >> >> >> >> >> pages/login.jsp > > There is no such file, see your file structure, there is > "User/pages/login.jsp" > >> >> > class="com.mkyong.user.action.WelcomeUserAction"> >> pages/welcome_user.jsp > > The same here, also result name is "success" not "SUCCESS" and you > can omit it if this is the only result type defined - "success" is by > default. > >> >> >> >> >> >> web.xml >> >> > "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" >> "http://java.sun.com/dtd/web-app_2_3.dtd"; > > > Not matching DTD, you are using 2.3 but declared 2.5 version of the > Servlet API in the pom - should be the same. > >> >> Struts 2 Web Application >> >> >> struts2 >> >> >> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter > > The filter name is wrong, it has changed starting with Struts 2.5 > https://struts.apache.org/docs/struts-23-to-25-migration.html#Struts2.3to2.5migration-StrutsPrepareAndExecuteFilter > > And finally you should based on out Getting Started Guide which we try > to keep up to date with the latest Struts version > http://struts.apache.org/getting-started/ > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How can I convert .jsp to .ftl (freemarker)?
Yes On Sat, Jun 24, 2017 at 2:05 AM, Lukasz Lenart wrote: > Did that help? > > W dniu pt., 23.06.2017 o 17:55 ssmtpmailtesting ssmtpmailtesting < > ssmtpmailtest...@gmail.com> napisał(a): > >> Thank you Lukasz Lenart >> >> On Fri, Jun 23, 2017 at 9:44 PM, Lukasz Lenart >> wrote: >> > Did you change a result type? >> > >> > W dniu pt., 23.06.2017 o 16:45 Christoph Nenning < >> > christoph.nenn...@lex-com.net> napisał(a): >> > >> >> > From: ssmtpmailtesting ssmtpmailtesting >> >> > To: Struts Users Mailing List , >> >> > lukaszlen...@apache.org, >> >> > Date: 23.06.2017 14:54 >> >> > Subject: Re: How can I convert .jsp to .ftl (freemarker)? >> >> > >> >> > I tried this: >> >> > >> >> > >> >> > >> >> > >> >> > Login Form >> >> > >> >> > >> >> > Struts 2 Hello World Example >> >> > >> >> > <@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 /> >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > still it's not outputting html form. >> >> >> >> >> >> Any errors in logs? >> >> >> >> >> >> regards, >> >> Christoph >> >> >> >> >> >> > >> >> > On Fri, Jun 23, 2017 at 6:33 PM, Lukasz Lenart >> >> > wrote: >> >> > > 2017-06-23 13:19 GMT+02:00 Christoph Nenning >> >> > : >> >> > >> One thing that catches my eye: in freemarker you have to replace >> >> colons >> >> > >> with dots: >> >> > >> >> >> > >> <@s.form action="Welcome" method="post"> >> >> > > >> >> > > Exactly, that's a case >> >> > > https://struts.apache.org/docs/freemarker-tags.html >> >> > > >> >> > > >> >> > > Regards >> >> > > -- >> >> > > Łukasz >> >> > > + 48 606 323 122 http://www.lenart.org.pl/ >> >> > > >> >> > > >> - >> >> > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> >> > > For additional commands, e-mail: user-h...@struts.apache.org >> >> > > >> >> > >> >> > - >> >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> >> > For additional commands, e-mail: user-h...@struts.apache.org >> >> > >> >> >> >> This Email was scanned by Sophos Anti Virus >> >> >> > -- >> > (mobile) >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> -- > (mobile) - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Limitations using Struts2-conventions-plugin (lack of multiple configuration roots)
Yes, something like that. But I think i can be done in a hackish way without much change. Really it is the conventions plugin that is at fault, or rather a lack of convention regarding sharing configuration that aught to be standardized. The beans and constants are currently scoped globally, just inside the the beans in struts2-conventions-plugin struts-plugin.xml file can only be set once. Consider the struts2-rest plugin, at a quick glance of the setup documentation it is clear that it wants to impose it's own conventions: https://cwiki.apache.org/confluence/display/WW/REST+Plugin you will see a number of blocks such as: Which are required in the setup. This isn't as simple as it aught to be, there should be a number of packages defined in the rest plugins struts-plugin.xml and by extending that get the most typical configurations (obviously every configuration can't be known but a couple choices wouldn't be bad). Is it reasonable for people to be intimately familiar with the conventions configuration such that they would know how to configure the rest plugin? As it stands this seems to be the case but in terms of user experience, it's a bit of a pain and if you want both your conventions AND the rest plugin, you find yourself being stuck (like an under-inflated balloon animal, you can choose to have the head inflated of the tail, but not both). This is one possible way to solve the issue: - Create a new interceptor called "PackageConfigurationInterceptor"; since interceptors are instantiated once per package they have the scope that I would expect. - When using conventions scan for the existence of this interceptor, if found use it's beans and constants in place of the global ones. === package com.kenmcwilliams.struts.config; public class ConventionsPackageConfigInterceptor extends PackageConfigInterceptor { public ConventionsPackageConfigInterceptor() { super(); // this.beans.add(new StrutsBean("com.opensymphony.xwork2.UnknownHandler", "convention", "org.apache.struts2.convention.ConventionUnknownHandler")); // // // // // this.beans.add(new StrutsBean("org.apache.struts2.convention.ActionConfigBuilder", "convention", "org.apache.struts2.convention.PackageBasedActionConfigBuilder")); this.beans.add(new StrutsBean("org.apache.struts2.convention.ActionNameBuilder", "convention", "org.apache.struts2.convention.SEOActionNameBuilder")); this.beans.add(new StrutsBean("org.apache.struts2.convention.ResultMapBuilder", "convention", "org.apache.struts2.convention.DefaultResultMapBuilder")); this.beans.add(new StrutsBean("org.apache.struts2.convention.InterceptorMapBuilder", "convention", "org.apache.struts2.convention.DefaultInterceptorMapBuilder")); this.beans.add(new StrutsBean("org.apache.struts2.convention.ConventionsService", "convention", "org.apache.struts2.convention.ConventionsServiceImpl")); // // // this.beans.add(new StrutsBean("com.opensymphony.xwork2.config.PackageProvider", "convention.packageProvider", "org.apache.struts2.convention.ClasspathPackageProvider")); this.beans.add(new StrutsBean("com.opensymphony.xwork2.config.PackageProvider", "convention.packageProvider", "org.apache.struts2.convention.ClasspathConfigurationProvider")); // // // // // this.constants.add(new StrutsConstant("struts.convention.actionConfigBuilder", "convention")); this.constants.add(new StrutsConstant("struts.convention.actionNameBuilder", "convention")); this.constants.add(new StrutsConstant("struts.convention.resultMapBuilder", "convention")); this.constants.add(new StrutsConstant("struts.convention.interceptorMapBuilder", "convention")); this.constants.add(new StrutsConstant("struts.convention.conventionsService", "convention")); // // // // // // // // // // // // // // // // // // // this.constants.add(new StrutsConstant("struts.convention.result.path", "/WEB-INF/content/")); this.constants.add(new StrutsConstant("struts.convention.result.flatLayout", "true")); this.constants.add(new StrutsConstant("struts.convention.action.suffix", "Action")); this.constants.add(new StrutsConstant("struts.convention.action.disableScanning", "false")); this.constants.add(new StrutsConstant("struts.convention.action.mapAllMatches", "false")); this.constants.add(new StrutsConstant("struts.convention.action.checkImplementsAction", "true")); this.constants.add(new StrutsConstant("struts.convention.default.parent.package", "convention-default")); this.constants.add(new StrutsConstant("struts.convention.action.name.lowercase", "true")); this.constants.add(new StrutsConstant("struts.convention.action.name.separator", "-")); this.constants.add(new StrutsConstant("struts.convention.package.locators", "action,actions,str
Re: How can I convert .jsp to .ftl (freemarker)?
Did that help? W dniu pt., 23.06.2017 o 17:55 ssmtpmailtesting ssmtpmailtesting < ssmtpmailtest...@gmail.com> napisał(a): > Thank you Lukasz Lenart > > On Fri, Jun 23, 2017 at 9:44 PM, Lukasz Lenart > wrote: > > Did you change a result type? > > > > W dniu pt., 23.06.2017 o 16:45 Christoph Nenning < > > christoph.nenn...@lex-com.net> napisał(a): > > > >> > From: ssmtpmailtesting ssmtpmailtesting > >> > To: Struts Users Mailing List , > >> > lukaszlen...@apache.org, > >> > Date: 23.06.2017 14:54 > >> > Subject: Re: How can I convert .jsp to .ftl (freemarker)? > >> > > >> > I tried this: > >> > > >> > > >> > > >> > > >> > Login Form > >> > > >> > > >> > Struts 2 Hello World Example > >> > > >> > <@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 /> > >> > > >> > > >> > > >> > > >> > > >> > still it's not outputting html form. > >> > >> > >> Any errors in logs? > >> > >> > >> regards, > >> Christoph > >> > >> > >> > > >> > On Fri, Jun 23, 2017 at 6:33 PM, Lukasz Lenart > >> > wrote: > >> > > 2017-06-23 13:19 GMT+02:00 Christoph Nenning > >> > : > >> > >> One thing that catches my eye: in freemarker you have to replace > >> colons > >> > >> with dots: > >> > >> > >> > >> <@s.form action="Welcome" method="post"> > >> > > > >> > > Exactly, that's a case > >> > > https://struts.apache.org/docs/freemarker-tags.html > >> > > > >> > > > >> > > Regards > >> > > -- > >> > > Łukasz > >> > > + 48 606 323 122 http://www.lenart.org.pl/ > >> > > > >> > > > - > >> > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> > > For additional commands, e-mail: user-h...@struts.apache.org > >> > > > >> > > >> > - > >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> > For additional commands, e-mail: user-h...@struts.apache.org > >> > > >> > >> This Email was scanned by Sophos Anti Virus > >> > > -- > > (mobile) > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- (mobile)
Re: How can I convert .jsp to .ftl (freemarker)?
Thank you Lukasz Lenart On Fri, Jun 23, 2017 at 9:44 PM, Lukasz Lenart wrote: > Did you change a result type? > > W dniu pt., 23.06.2017 o 16:45 Christoph Nenning < > christoph.nenn...@lex-com.net> napisał(a): > >> > From: ssmtpmailtesting ssmtpmailtesting >> > To: Struts Users Mailing List , >> > lukaszlen...@apache.org, >> > Date: 23.06.2017 14:54 >> > Subject: Re: How can I convert .jsp to .ftl (freemarker)? >> > >> > I tried this: >> > >> > >> > >> > >> > Login Form >> > >> > >> > Struts 2 Hello World Example >> > >> > <@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 /> >> > >> > >> > >> > >> > >> > still it's not outputting html form. >> >> >> Any errors in logs? >> >> >> regards, >> Christoph >> >> >> > >> > On Fri, Jun 23, 2017 at 6:33 PM, Lukasz Lenart >> > wrote: >> > > 2017-06-23 13:19 GMT+02:00 Christoph Nenning >> > : >> > >> One thing that catches my eye: in freemarker you have to replace >> colons >> > >> with dots: >> > >> >> > >> <@s.form action="Welcome" method="post"> >> > > >> > > Exactly, that's a case >> > > https://struts.apache.org/docs/freemarker-tags.html >> > > >> > > >> > > Regards >> > > -- >> > > Łukasz >> > > + 48 606 323 122 http://www.lenart.org.pl/ >> > > >> > > - >> > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> > > For additional commands, e-mail: user-h...@struts.apache.org >> > > >> > >> > - >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> > For additional commands, e-mail: user-h...@struts.apache.org >> > >> >> This Email was scanned by Sophos Anti Virus >> > -- > (mobile) - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How can I convert .jsp to .ftl (freemarker)?
Did you change a result type? W dniu pt., 23.06.2017 o 16:45 Christoph Nenning < christoph.nenn...@lex-com.net> napisał(a): > > From: ssmtpmailtesting ssmtpmailtesting > > To: Struts Users Mailing List , > > lukaszlen...@apache.org, > > Date: 23.06.2017 14:54 > > Subject: Re: How can I convert .jsp to .ftl (freemarker)? > > > > I tried this: > > > > > > > > > > Login Form > > > > > > Struts 2 Hello World Example > > > > <@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 /> > > > > > > > > > > > > still it's not outputting html form. > > > Any errors in logs? > > > regards, > Christoph > > > > > > On Fri, Jun 23, 2017 at 6:33 PM, Lukasz Lenart > > wrote: > > > 2017-06-23 13:19 GMT+02:00 Christoph Nenning > > : > > >> One thing that catches my eye: in freemarker you have to replace > colons > > >> with dots: > > >> > > >> <@s.form action="Welcome" method="post"> > > > > > > Exactly, that's a case > > > https://struts.apache.org/docs/freemarker-tags.html > > > > > > > > > Regards > > > -- > > > Łukasz > > > + 48 606 323 122 http://www.lenart.org.pl/ > > > > > > - > > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > This Email was scanned by Sophos Anti Virus > -- (mobile)
Re: How can I convert .jsp to .ftl (freemarker)?
> From: ssmtpmailtesting ssmtpmailtesting > To: Struts Users Mailing List , > lukaszlen...@apache.org, > Date: 23.06.2017 14:54 > Subject: Re: How can I convert .jsp to .ftl (freemarker)? > > I tried this: > > > > > Login Form > > > Struts 2 Hello World Example > > <@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 /> > > > > > > still it's not outputting html form. Any errors in logs? regards, Christoph > > On Fri, Jun 23, 2017 at 6:33 PM, Lukasz Lenart > wrote: > > 2017-06-23 13:19 GMT+02:00 Christoph Nenning > : > >> One thing that catches my eye: in freemarker you have to replace colons > >> with dots: > >> > >> <@s.form action="Welcome" method="post"> > > > > Exactly, that's a case > > https://struts.apache.org/docs/freemarker-tags.html > > > > > > Regards > > -- > > Łukasz > > + 48 606 323 122 http://www.lenart.org.pl/ > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > This Email was scanned by Sophos Anti Virus
Re: How can I convert .jsp to .ftl (freemarker)?
I tried this: Login Form Struts 2 Hello World Example <@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 /> still it's not outputting html form. On Fri, Jun 23, 2017 at 6:33 PM, Lukasz Lenart wrote: > 2017-06-23 13:19 GMT+02:00 Christoph Nenning : >> One thing that catches my eye: in freemarker you have to replace colons >> with dots: >> >> <@s.form action="Welcome" method="post"> > > Exactly, that's a case > https://struts.apache.org/docs/freemarker-tags.html > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How can I convert .jsp to .ftl (freemarker)?
2017-06-23 13:19 GMT+02:00 Christoph Nenning : > One thing that catches my eye: in freemarker you have to replace colons > with dots: > > <@s.form action="Welcome" method="post"> Exactly, that's a case https://struts.apache.org/docs/freemarker-tags.html Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How can I convert .jsp to .ftl (freemarker)?
> From: ssmtpmailtesting ssmtpmailtesting > 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"%> > > > > Login Form > > > Struts 2 Hello World Example > > > > > > > > > > > > > I tried this: login.ftl = > > <#assign s=JspTaglibs["struts-tags.tld"] /> > > > Login Form > > > Struts 2 Hello World Example > > <@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 /> > > > > > > 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
How can I convert .jsp to .ftl (freemarker)?
login.jsp = <%@ taglib prefix="s" uri="/struts-tags"%> <%@ page contentType="text/html; charset=UTF-8"%> Login Form Struts 2 Hello World Example I tried this: login.ftl = <#assign s=JspTaglibs["struts-tags.tld"] /> Login Form Struts 2 Hello World Example <@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 /> But it didn't output html form. How can I convert from .jsp to .ftl? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org