Mike Nason

Greenhorn
+ Follow
since Apr 19, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Nason

Hello!

Does anybody knows is it allowed to call syncronized method from EjbBean(sync method in other object, not in ejb)?

My problem is the following: the database table has rows.
An operator uses GUI to get rows from db to browse, then can modify any single row(also do some other things).

Many operators are working with GUI, so 2 operators can browse the same rows, but one row can be modified by one operator only.
I use EJB to get & modify rows. My web module calls EJB to perform fetching and modification.

The problem is when EJB instance(operator1) is modifing some DB record, the other EJB instance(operator2) overwrite the changes.

The solution can be to place modification logic to syncronized method, so this method will be called from multiple EJB instances.
Is it allowed?
Any other ideas?

I use EJB 2.1.

Thanks.
You can have


which means that users with any roles are able to procees to protected resource.
8 years ago
You need LDAP authentication to recognize users who they are, then you'll need authorization code to assign apropriate resources to user by his role.
Once user authenticated on LDAP, he is assigned a role, then if you have a table of roles in your db you can check by isUserInRole(String role).

8 years ago
Hello!
We are using LDAP authentication, so when user enter Active Directory user/pass he is able to view jsp page.


I need all users(any role users) that authenticated successfully using LDAP will be able to process to site, so I am able to show apropriate content based on their roles.
How can I configure security-constraint to allow any role get in?
<role-name>*</role-name> doesn't work!
Thanks.
8 years ago
Hello!
When my JPS files are in WEB-INF/jsp (preventing to access them directly) I can't apply css files to them!

I wrote <link rel="stylesheet" type="text/css" media="screen" href="../../styles/global.css"> - it doesnt work!

Where can I put css files and how to link them from jsp?
8 years ago
JSP
We have application that handles http request then push http request back as a response.
The load is very hight, so I have a HttpRequestThread to perform http request for each http request handled by my application.
That thread has blocking queue of request that need to be posted, so not to make servlet thread( the thread that handles original incoming request) waiting I put httpPost task to blocking queue, so the post task will be handled in other thread...

The other thing is that we need to check database from time to time so I need java.util.Timer there (which is also the thread)

So on...
I have a thread running and need to stop it, because of undeploying web app.
What I've done is the like the code below:

but that is not actually work! (test with profiler). When ear application is undeployed there were still some threads that are running, so I did the cancel flag like that

that is working good!
Why interrupt() is not working to stop the thread?
We have the application that consists of EAR + web module (war) inside, deployed on Glassfish.
I need multiple threads inside war, so I used new Thread().start() to create them.
Some guys said that it is not correct to create custom threads inside j2ee container, so I need to use other tools provided by j2ee container to do this.

Actually I have read j2ee5 specification and didn't notice anything special concerning new threads there, except EJB container, inside of which the creation of new threads are not allowed.

It is ok to create the new threads inside glassfish web module with thread.start()?
We have site to browse catalog and some actions+jsp:
1. ShowItems + listItems.jsp - to show list of categories = start page
2. ShowProductList + listProducts.jsp - to show list of products
3. ShowProductDetails + productDetails.jsp - to show product details.

The thing is when user clicks on ShowProductList and list contains one item the result should be ShowProductDetails.
I have an idea to reuse ShowProductDetails and I need to do it without send redirect (because it's bad for client performance)

I have an idea to use ActionChaining but don't know how to do it, because these 2 actions have different params, and
patterns doesn't work as in type="redirect-action".
I need to be able to pass params from one action to another. Any ideas?
8 years ago
We are doing a we site for mobile devices and when using s:form it includes name="sendMail" onsubmit="return true;" attributes there.

We don't need these, how can I turn rendering these tags off?

We use <s:form action="sendMail" method="get" theme="simple" namespace="/">
8 years ago
I have a problem with a site on struts2.
First I developed the site on http://localhost:8080/site
Then QA team deployed it to http://testmachine/site - all worked ok.
Then QA created http://sub.anotherdomain.com that pointed to http://testmachine/site - and that is where problems began.
I notice that all links was like http://sub.anotherdomain.com/site/some.action - it means that the real path link was pointing to was http://testmachine/site/site/some.action which was wrong.
The struts tag included the webapp context path (/site) which was the place the site actually deployed.

I found the way to work only on http://sub.anotherdomain.com/ or on http://testmachine/ (root context) with same way. I changed the includeContext="false" on all s:url tags. But that is not working with s:form that is still includes context information in action="sendMail.action".

1. How to have my site working both on http://testmachine/site and http://sub.anotherdomain.com/ >pointed to>http://testmachine/site
or
2. How to have <s:form action="sendMail.action" method="get" theme="simple"> pointed to http://sub.anotherdomain.com/sendMail.action but not on http://sub.anotherdomain.com/site/sendMail.action ??
8 years ago
Hello!
I'am Java Developer with 4 years of experience.
We recently finished a project on OSGI development and its in production now. However it was terrible to have it done and we had a huge bug list from QA team.

Now Iam working on another project on Tomcat and have some time left...

What I would like is to participate in some enterprise project as a developer(advisor) _for free_(means without paying any money to me). It will be cool if it will be concerning OSGI(fuse, servicemix etc) development or UI front-end development. My expirience was basically on java back-end except a couple of projects as JSP/Struts developer, so I will be happy to take some JSF/Seam/XML+XSLT I can be available 10 - 20 hours per week, and would like to take more experience in OSGI/front-end development.

Feel free to contact me via email on to discuss the details.

Thanks.
8 years ago
Does anybody know how to develop&deploy OSGi bundle to FUSE ESB?
What dependencies do I need and what plugin should I use for deployment?

Thanks.
I am using struts2 and need to show/hide some textboxes in my <s:form>.
I did this by using JS code:

The problem that these method doesn't work with default xhtml theme, and I need to set <s:form theme="simple"> and use custom layout to make that works.
Using simple theme broke my UI on that page, because I am using default struts2 layout on others.
Does anybody have any ideas of how to show/hide textboxes by using default html theme with struts2 layout???
9 years ago
Good point!
Thanks!

The problem is that xml files is not included in .war file!
I use Maven2 and didn't do anything special configuration, just point in pom.xml

I should do something to point maven to include xml files as well in final war.
9 years ago