Re: Struts examples Hello World

2024-04-17 Thread Tim Mousaw
Thank you! I just wanted to be sure I wasn't missing anything. I'll need to
read up on how that configuration value works to understand why this line
causes it not to work. I'll put up a PR to make the code match the
documentation of the Hello World example.

On Wed, Apr 17, 2024 at 12:43 AM Lukasz Lenart 
wrote:

> niedz., 14 kwi 2024 o 20:56 Tim Mousaw  napisał(a):
> >
> > I started to go through the Getting Started examples at
> > https://struts.apache.org/getting-started/index.html. I downloaded all
> the
> > examples from https://github.com/apache/struts-examples. I would expect
> > that I should be able to run `mvn jetty:run` from any of the examples,
> > follow the appropriate link, and it should work as in the corresponding
> > tutorial. However, this breaks down very quickly as when I try to run
> that
> > for the `helloworld` example, I get the following error in my web browser
> > when going to the link http://localhost:8080/helloworld/index.action:
> > HTTP ERROR 404 Not Found
> > URI: /helloworld/index.action
> > STATUS: 404
> > MESSAGE: Not Found
> > SERVLET: default
> > --
> > Powered by Jetty:// 9.4.46.v20220331 
> >
> > With debug logging enabled, navigating to
> > localhost:8080/helloworld/index.action spits the following two lines of
> > output to the console:
> > 2024-04-14 14:44:44,340 DEBUG [qtp273531298-62]
> config.ConfigurationManager
> > (ConfigurationManager.java:180) - Checking ConfigurationProviders for
> > reload.
> > 2024-04-14 14:44:44,343 DEBUG [qtp273531298-62]
> > impl.InstantiatingNullHandler (InstantiatingNullHandler.java:98) -
> Entering
> > nullPropertyValue
> > [target=[com.opensymphony.xwork2.DefaultTextProvider@6dbebaa7],
> > property=struts]
> >
> > If I remove the line " value=","/>"
> > from struts.xml, then the example seems to work. It gets the same two
> lines
> > of output to the console followed by:
>
> You are right, by removing this constant you make Struts to fallback
> to default configuration [1] which supports both .action and no suffix
> in the url
>
> [1]
> https://github.com/apache/struts/blob/master/core/src/main/resources/org/apache/struts2/default.properties#L87
>
> > 2024-04-14 14:51:46,765 DEBUG [qtp273531298-50] xwork2.DefaultActionProxy
> > (DefaultActionProxy.java:85) - Creating an DefaultActionProxy for
> namespace
> > [/] and action name [index]
> >
> > As well as a bunch of other logging after that before the page renders.
> > From searching for this configuration, I think the intention of this line
> > is to remove the `.action` suffix from the action (e.g. the link in the
> web
> > browser displays localhost:8080/helloworld/index rather than
> > http://localhost:8080/helloworld/index.action). So, I'm curious what I
> have
> > configured wrong that doesn't allow this to work. I'm using Java 21
> > (Corretto). Let me know if there are other dependencies that you need to
> > know the version of.
>
> As you notice what was documented on the page doesn't match the
> example Hello World application. So either you can prepare a PR fixing
> the documentation or the example app.
>
>
> Cheers
> Lukasz
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Struts examples Hello World

2024-04-16 Thread Lukasz Lenart
niedz., 14 kwi 2024 o 20:56 Tim Mousaw  napisał(a):
>
> I started to go through the Getting Started examples at
> https://struts.apache.org/getting-started/index.html. I downloaded all the
> examples from https://github.com/apache/struts-examples. I would expect
> that I should be able to run `mvn jetty:run` from any of the examples,
> follow the appropriate link, and it should work as in the corresponding
> tutorial. However, this breaks down very quickly as when I try to run that
> for the `helloworld` example, I get the following error in my web browser
> when going to the link http://localhost:8080/helloworld/index.action:
> HTTP ERROR 404 Not Found
> URI: /helloworld/index.action
> STATUS: 404
> MESSAGE: Not Found
> SERVLET: default
> --
> Powered by Jetty:// 9.4.46.v20220331 
>
> With debug logging enabled, navigating to
> localhost:8080/helloworld/index.action spits the following two lines of
> output to the console:
> 2024-04-14 14:44:44,340 DEBUG [qtp273531298-62] config.ConfigurationManager
> (ConfigurationManager.java:180) - Checking ConfigurationProviders for
> reload.
> 2024-04-14 14:44:44,343 DEBUG [qtp273531298-62]
> impl.InstantiatingNullHandler (InstantiatingNullHandler.java:98) - Entering
> nullPropertyValue
> [target=[com.opensymphony.xwork2.DefaultTextProvider@6dbebaa7],
> property=struts]
>
> If I remove the line ""
> from struts.xml, then the example seems to work. It gets the same two lines
> of output to the console followed by:

You are right, by removing this constant you make Struts to fallback
to default configuration [1] which supports both .action and no suffix
in the url

[1] 
https://github.com/apache/struts/blob/master/core/src/main/resources/org/apache/struts2/default.properties#L87

> 2024-04-14 14:51:46,765 DEBUG [qtp273531298-50] xwork2.DefaultActionProxy
> (DefaultActionProxy.java:85) - Creating an DefaultActionProxy for namespace
> [/] and action name [index]
>
> As well as a bunch of other logging after that before the page renders.
> From searching for this configuration, I think the intention of this line
> is to remove the `.action` suffix from the action (e.g. the link in the web
> browser displays localhost:8080/helloworld/index rather than
> http://localhost:8080/helloworld/index.action). So, I'm curious what I have
> configured wrong that doesn't allow this to work. I'm using Java 21
> (Corretto). Let me know if there are other dependencies that you need to
> know the version of.

As you notice what was documented on the page doesn't match the
example Hello World application. So either you can prepare a PR fixing
the documentation or the example app.


Cheers
Lukasz

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts examples Hello World

2024-04-16 Thread Tim Mousaw
I forgot to mention, I am on Windows 11 Home Version 23H2 OS Build
22631.3447. I have also tried via WSL 2 on an Ubuntu 20.04.6 LTS (focal)
and had the same result.

On Sun, Apr 14, 2024 at 2:54 PM Tim Mousaw  wrote:

> I started to go through the Getting Started examples at
> https://struts.apache.org/getting-started/index.html. I downloaded all
> the examples from https://github.com/apache/struts-examples. I would
> expect that I should be able to run `mvn jetty:run` from any of the
> examples, follow the appropriate link, and it should work as in the
> corresponding tutorial. However, this breaks down very quickly as when I
> try to run that for the `helloworld` example, I get the following error in
> my web browser when going to the link
> http://localhost:8080/helloworld/index.action:
> HTTP ERROR 404 Not Found
> URI: /helloworld/index.action
> STATUS: 404
> MESSAGE: Not Found
> SERVLET: default
> --
> Powered by Jetty:// 9.4.46.v20220331 
>
> With debug logging enabled, navigating to
> localhost:8080/helloworld/index.action spits the following two lines of
> output to the console:
> 2024-04-14 14:44:44,340 DEBUG [qtp273531298-62]
> config.ConfigurationManager (ConfigurationManager.java:180) - Checking
> ConfigurationProviders for reload.
> 2024-04-14 14:44:44,343 DEBUG [qtp273531298-62]
> impl.InstantiatingNullHandler (InstantiatingNullHandler.java:98) - Entering
> nullPropertyValue
> [target=[com.opensymphony.xwork2.DefaultTextProvider@6dbebaa7],
> property=struts]
>
> If I remove the line " value=","/>" from struts.xml, then the example seems to work. It gets the
> same two lines of output to the console followed by:
> 2024-04-14 14:51:46,765 DEBUG [qtp273531298-50] xwork2.DefaultActionProxy
> (DefaultActionProxy.java:85) - Creating an DefaultActionProxy for namespace
> [/] and action name [index]
>
> As well as a bunch of other logging after that before the page renders.
> From searching for this configuration, I think the intention of this line
> is to remove the `.action` suffix from the action (e.g. the link in the web
> browser displays localhost:8080/helloworld/index rather than
> http://localhost:8080/helloworld/index.action). So, I'm curious what I
> have configured wrong that doesn't allow this to work. I'm using Java 21
> (Corretto). Let me know if there are other dependencies that you need to
> know the version of.
>
> Any help would be greatly appreciated.
>
> Thanks,
> Tim Mousaw
>


Struts examples Hello World

2024-04-14 Thread Tim Mousaw
I started to go through the Getting Started examples at
https://struts.apache.org/getting-started/index.html. I downloaded all the
examples from https://github.com/apache/struts-examples. I would expect
that I should be able to run `mvn jetty:run` from any of the examples,
follow the appropriate link, and it should work as in the corresponding
tutorial. However, this breaks down very quickly as when I try to run that
for the `helloworld` example, I get the following error in my web browser
when going to the link http://localhost:8080/helloworld/index.action:
HTTP ERROR 404 Not Found
URI: /helloworld/index.action
STATUS: 404
MESSAGE: Not Found
SERVLET: default
--
Powered by Jetty:// 9.4.46.v20220331 

With debug logging enabled, navigating to
localhost:8080/helloworld/index.action spits the following two lines of
output to the console:
2024-04-14 14:44:44,340 DEBUG [qtp273531298-62] config.ConfigurationManager
(ConfigurationManager.java:180) - Checking ConfigurationProviders for
reload.
2024-04-14 14:44:44,343 DEBUG [qtp273531298-62]
impl.InstantiatingNullHandler (InstantiatingNullHandler.java:98) - Entering
nullPropertyValue
[target=[com.opensymphony.xwork2.DefaultTextProvider@6dbebaa7],
property=struts]

If I remove the line ""
from struts.xml, then the example seems to work. It gets the same two lines
of output to the console followed by:
2024-04-14 14:51:46,765 DEBUG [qtp273531298-50] xwork2.DefaultActionProxy
(DefaultActionProxy.java:85) - Creating an DefaultActionProxy for namespace
[/] and action name [index]

As well as a bunch of other logging after that before the page renders.
>From searching for this configuration, I think the intention of this line
is to remove the `.action` suffix from the action (e.g. the link in the web
browser displays localhost:8080/helloworld/index rather than
http://localhost:8080/helloworld/index.action). So, I'm curious what I have
configured wrong that doesn't allow this to work. I'm using Java 21
(Corretto). Let me know if there are other dependencies that you need to
know the version of.

Any help would be greatly appreciated.

Thanks,
Tim Mousaw