Zahro Alfelpha

Ranch Hand
+ Follow
since May 24, 2016
Zahro likes ...
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
47
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

Recent posts by Zahro Alfelpha

First of all it's weird to me that they even call it "Legacy" projects. So because it isn't Spring Boot it's legacy? Whatever. Anyways, The templates for Spring MVC seem to be terribly outdated. Choosing a new Spring MVC Project results in a Spring 3.2.2 project using Java 5. It says the url for the template is http://dist.springsource.com/release/STS/help/org.springframework.templates.mvc-3.2.2.zip. I can't seem to find the url to use a more up to date template. Can anyone point me in the right direction? (and no I don't mean a link to download IntelliJ lol). I am using Eclipse Neon 3.
7 years ago
I assume you're looking for something like this
7 years ago

Joe Ess wrote:I would recommend using the standard​ JEE security mechanism built into the servlet container



Thanks, I will look into this.
7 years ago

Joe Ess wrote: Exactly what do you want to accomplish with annotations?



I'm using a servlet filter to prevent unauthorized access to some pages. Currently the list of protected paths is kept in a list of strings and the filter compares the request path to the list.

What I would like to do is create an annotation to put on the Action classes themselves, and then simply check for that annotation on whichever Action is passing through the filter.
7 years ago

Joe Ess wrote:Don't use Struts 1.x unless you have a very good reason.



Unfortunately that is beyond my control at the moment but trust me I'd love to not be using Struts at all.

Joe Ess wrote:it appears that the Struts 1.x API works the same way as far as action context is concerned.



I'm not sure this is the case. I am finding no static getActionContext method in org.apache.struts.chain.contexts.ServletActionContext

I really appreciate your replies.
7 years ago

Joe Ess wrote:

Zahro Alfelpha wrote:

Bear Bibeault wrote:Fixed



thanks! so is it even possible to edit/delete posts?



You should be able to edit your own posts.  I don't know if you can edit titles (I can, but I'm a moderator).
The reason your code isn't working is because you are creating your own context object instances instead of obtaining those that are available via the framework.  To get the current ServletActionContext instance, you should use the getActionContext method.



This is the part where I cry and tell you that I'm using Java 5 and Struts 1.3....
7 years ago

Bear Bibeault wrote:Fixed



thanks! so is it even possible to edit/delete posts?
7 years ago
I am using a servlet filter where I am trying to get action associated with the current request.

Relevant sections of my filter:


My problem is that `action` ends up being null. Both of the context variables get populated with a value, but for some reason it cant find the action. Any ideas? Thanks!
7 years ago

Paul Clapham wrote:You're assuming that if Session A makes a request, and then subsequently Session B makes a request, then those two requests must be processed by different threads. I don't see why that should be the case: once Session A's request is finished, the thread which processed it should become available (via the thread pool) to be used by any subsequent request.



Thanks Paul, I ended up figuring it out. It turns out that there is a servlet filter whose job it is to sync the custom context to the active session. this custom context filter was declared in web xml after the filters that use the custom context, so this explains why the error was only happening inside of the filters :)
7 years ago
I am working on a messy Struts 1 application that makes use of a custom context class to store values throughout the application. Basically it is only used to store session scope variables. I guess the reason that this custom class is used is so that other classes which do not have access to the http session can still get and set the session variables.

Anyways, for the most part this works just fine. The custom context is used throughout the Actions and service classes to share variables with no problem. However, I just discovered that things do not work out so nicely using this custom context inside of an Http Filter! It appears that it randomly will pull the value from a different session. And by session, I actually mean thread, since this custom context uses ThreadLocale to do it's dirty work.

Take a look


Again, this seems to work just fine and dandy inside every other class other than a filter. Let me show you the filter where it messes up.




When the custom context is used to grab the user in the doFilter method, it will randomly grab the user object from another logged in user. Obviously not a good situation!

The only time this happens is after some activity from a different logged in user. I could sit there all day and keep refreshing user A's session and there wouldn't be an issue. However, after taking some action as user B and then refreshing user A's session again, it will usually be swapped. But then if I refresh user A's session again, things are back to normal.

I've noticed this happens extremely more frequently when the application is actually deployed to a remote development tomcat server. It still happens when running locally, but not nearly as often as when deployed remotely. It happens almost 100% of the time remotely.

I have examined the session variable inside of the filter, and there doesn't appear to be an issue with the session itself. I have confirmed that the session id is still correct even when the incorrect user is pulled from the ThreadLocale variable.

Can anyone help me out? Thanks.
7 years ago
I am trying to use Jersey to provide a simple web service for my struts application.

When I call the client action I get the following error

   com.sun.jersey.api.client.UniformInterfaceException
   Message: GET http://localhost:8080/shumer/rest/employee/get returned a response status of 404

servlet declaration in web.xml



Server resource



Client action



I have tried this with and without the `/get` and the end of the resource url, and with and without a leading `/` in the EmployeeResource @Path annotation. My guess is that there is somewhere I have to declare where my resources are lcoated at in order for the Jersey servlet to handle them, but I can't figure it out. A point in the right direction would be much appreciated.

   
7 years ago
I have a web application that uses Struts and iBatis. I am running the application inside of a tomcat server within Eclipse. Whenever I run a `SELECT` query that returns many rows, I get a `java.lang.OutOfMemoryError`. If I limit the amount of rows returned, then it doesn't happen. I have searched on this site for similar issues, and most of the answers talk about increasing the java heap size which I have done in the `eclipse.INI` file by setting it to 2048 via `-Xmx2048m`. I have also seen some people suggest changing the way in which jdbc handles the result set, but I have been unable to find how to do that using iBatis. Here is what my database settings look like




Full Stack Trace


vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |