Joe Ess

+ Follow
since Oct 29, 2001
Joe likes ...
Mac OS X Linux Windows
Forum Moderator
Joe Ess currently moderates these forums:
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Joe Ess

Note that this topic is over 9 years old, so it's unlikely that Hemanth will reply.  You should post your own topic with relevant details so we can better help you.
Have a look at this article, How to Ask Questions on Javaranch for some helpful advice to get the most out of our site.
7 months ago
Good to hear you figured it out. Thanks for checking back in.
1 year ago
I apologize if I'm off the wall, but I've never worked with annotations in Struts.  Shouldn't your namespace have a wildcard (the '*' character or a parameter in curly brackets) in it?  
Look at the examples here
1 year ago
They got rid of the separate Xwork jar file in 2.5.  There are some other things missing or have different versions than Struts expects.  Look at our FAQ on how to resolve Struts dependencies.
1 year ago
To my knowledge, there is no page listing the minimum set of dependencies for Struts 2.  The easiest way to obtain the dependencies is to use Maven or Ivy (if you are using Ant) in your build script.

If you are not using either of those build tools, or want to manage your project's dependencies manually, the minimum set of dependencies is available as a separate download.  Just click on the "Essential Dependencies Only" link on the Struts Download Page

The minimum set of dependencies for Struts 2.5.26 are:

Now, there will come a time when the base Struts functionality is not enough any more and one will want to introduce other technologies, such as Spring or Sitemesh.  Again, if using Maven, there are archetypes provided for some common application types.  

If one is manually maintaining their project's dependencies, it is possible to obtain some technologies, like Spring, from the distribution {struts version}/lib/ directory.  Since it will be necessary to obtain those dependencies and make sure they play well with Struts, I recommend starting here.

For example, Struts has a Spring plugin, but it is based on an old version of Spring (4.3.26, as opposed to the current 5.3.3). If one wants to try to update a library that is packaged with Struts, I would recommend that one use the supported version first.  Make sure your application works with that, then try introducing a newer version.  It would also be a good idea to check the Struts 2 Mailing Lists to see if anyone has tried a newer version of that library, and, if so, they encountered any issues.
1 year ago
Wow, it's been a while!  Good to see you again.
I don't see any obvious issues with your files. Did you upgrade your application's dependencies?  
1 year ago
It's been a long time since I worked with Struts, but I don't know that you can do this:

The way I understand it, the "value" attribute is supposed to be name of a getter in the action class.  The tag documentation has several examples or this example.  
1 year ago
I'm saying the variable will be in the Value Stack.  It's an integral part of Struts 2.  see here
My personal opinion is that scriptlets are awful and one should avoid them at all costs.  It would also be wise to sit down and learn how to use Struts 2 effectively.  By taking the half-and-half route, you are missing out on the benefits of using Struts 2 while also causing more problems for yourself by trying to write code to get around the framework.
1 year ago
The "var" attribute is the name of the iterator on the Value Stack (see here).  The tag is not creating a variable with that name.
1 year ago
Did you try it?  My wild guess would be that it would not work.  The two versions of Struts are very different code bases, including the JSP tag libraries.
1 year ago
So I ran into the same issue sending coordinates that end with a 0.  It looks like, rather than sending an HTML error response, the API sends a 301 response when it gets coordinates it doesn't like and my code doesn't handle that...
So apparently I'm sending too big a number.  The API doc says:

Please note that, for efficiency purposes, the API doesn’t support more than four decimal places of precision in coordinates. If you send a more precise coordinate, you’ll receive an error giving you the closest proper coordinate.

You can see above that the error I get is truncated to 4 decimal places.  The fact that the URL in the error message looks like the error was originating from localhost distracted me from this.  
I'm playing around with Angular, trying to create a weather forecast app.  I'm using the National Weather Service API for data.  There are 3 steps to retrieving a forecast:
1. get your latitude and longitude (the NWS doesn't offer geocoding, so we have to use a different api for this)
2. request the metadata ("points") for this location
3. using the points, request the forecast document.

Since this data resides on a server other than the one I'm working on, I need to proxy requests to the data servers.  I set up the proxy.conf.json like so:

Now, in my angular code, I make a request to the US Census Geocoder API:

The proxy rewrites this request and I get the latitude and longitude back.  The output from the proxy looks like:

Next, in my angular code, I perform the second step, taking the latitude and longitude and requesting the points from the NWS.  The URL I use looks like:

The output from the proxy is similar to the previous example, so it appears to do the correct thing rewriting the request:

However, I get a 404 error.  The weird thing is, the URL reported for the error isn't the one I requested nor is it the rewritten one.  

It's as if the proxy is trying to request the rewritten URL from localhost.

For another data point, I have another app in which I was working with another NWS API which basically goes by county (the API calls "zones").  Occasionally I will get failures when the service is overwhelmed.  The URL in those errors will be what I expect, the unrewritten URL with localhost:

Now, the API that uses zones doesn't require geocoding, so the app proxy config only has one entry for the target.  This leads me to believe that I have configured the proxy incorrectly.  Is this the case or is there something else wrong?

I knew nothing about Docker before reading this book and I found it a good introduction to the subject.  
There is a whole lot more to learn about containers, for example, it sidesteps Kubernetes (and rightly so, seeing as how that is a whole subject on its own).  That said, it is a solid starting point.
2 years ago

Ryan McGuire wrote:We're 95% (probably more) a Windows shop.

You make it sound like there's no Linux there!    The data center will spin up a Linux VM for a couple hundred bucks.

paul nisset wrote:I went through a bad/time wasting experience  with Docker for Windows on a Windows 10 laptop.

I tried Docker Toolbox on a maxed-out Windows workstation and had no end to problems.  I installed Docker on a Linux virtual machine on that desktop and it worked fine, at least for some academic work.
2 years ago