Michael Brown

Greenhorn
+ Follow
since May 05, 2008
Merit badge: grant badges
For More
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 Michael Brown

Bear Bibeault wrote:

Or are you trying to move it into this position as part of an animation?



Yes, this is exactly what I would like to do...

One option is to create this div when page loads ( and set it's display: none) and position it later it in the lower left corner and show it...

Or to create it dynamically and then position it it in the lower left corner and show it...

Hello!

Can somebody help me with this problem:

I started learning jQuery, and cannot figure out how to position some div in lower left corner of my browser...?


This div's ID is , for example "myDiv", and is not visible.

I want to position it, and then show it using .show() function

Thanks!
Hi to all!

I have one short question:

at work, we log to our computers using active directory accounts and all of the privileges are set by our security department ( I guess using active directory itself? ).

One of the things that they disabled while browsing internet is javascript. Because of that , many web sites that uses JavaScript simply don't function properly when I open it from office. However, some sites still do! At least most of JavaScript that they use... And some function entirely ( for example sites developed using gwt, such as gmail ).

I was just wondering, what do I need to do when developing some web application, so that I could use it weather or not someone disabled use of JavaScript inside some company...?
It doesn't work because of javascript , not struts2...
13 years ago
Hello to everyone!

I have a short question, and hope that someone could help me...


Can I map other result names in struts mapping, and not just "success", "input", "error","login" and others that come with struts.

Can I say ( in some action class , in Execute() method) :



and in mapping say something like



If "yes", what do I need to do to enable all this...
13 years ago

David Newton wrote:Is it working if you don't open the new window?

My guess would be that since the tokens are generated on a session level that there's an entirely new token in the new window (since it's a new request), which basically blasts away the old one from the original window. I can't think of a trivial way around this, if that's what's actually wrong.



Hi David!

Yes, if I don't open a new window and enter some data in it, it work just fine...

I cannot believe that there is no solution for this kind of situation when someone needs to open a LOV ( list of values ) while entering some data in a JSP, and eventually sometimes add data to this LOV and then select a row from it in order to complete main transaction...

14 years ago
Hi to all!

I have an action in which I enter some data that are about to be inserted into Database.
Let's call it NewTransaction.action

When I click on the button "save" , it opens action DoInsert.action which does the actual insert.

Now, this is how my DoInsert action looks in struts.xml:


Here is my problem:

When entering data in NewTransaction.action , sometimes I need to open a new window and insert some data in order to select it in NewTransaction.action.
But, when I try to save NewTransaction.action , invalid.token error occures!

I tried this by opening a link in a new window with


And it really opens in new window, it saves, but later I cannot save my NewTransaction...

How can I prevent this?

14 years ago
Yes, now that I think about it - you're right...

My application is written using struts2, but this is not Struts2 related question...

My appologies...
14 years ago
Hi,

I have a JNDIRealm in my context.xml that connects to Active Directory in order to authorise users in application...

It all works fine.

I'm just wondering if there is a way to read this JNDIRealm settings ( connectionName , connectionPassword and connectionURL ) dynamically from some Java class inside my application...?

For example using something like Context.lookup("MyRealm") and getting it's properties...

I use Tomcat 6.
14 years ago
Hi David,

Thank you very much for your answers!
I appreciate it!

Use a dynamic result? You can use OGNL expressions in result declarations.



This sounds like a solution to my problems...

I'll give it a try!
14 years ago
First of all, I made a small mistake: I need just an ordinary "redirect" , not "redirect-action"

Why? There's almost never any reason to build a result dynamically in the code itself (and I suspect it's difficult enough to be impractical). What are you trying to do that you don't believe can't be done via normal means?



Let's say I have ActionSupport "a" whose view is "a.jsp" and on submit I "call" ActionSupport "b" that needs to insert some data in the DB and redirect to action "a" ( go to the beginning )

And what if I have N such "circles" for every table in the DB.
That way I would map N actions "a" + N actions "b" in the struts.xml

I want to make universal action "b" that will do the insertion of the data no matter how that data looks like , and redirect to some action that I specified in some String...
That way I don't need to map those N "b" actions in the struts.xml

This is just, of course, simplified version of what I'm doing...

14 years ago
Yes, If I want to use struts.xml

But I want to create redirect-action within code of my ActionSupport class...

How to do that?

14 years ago
Hy,

Can , please, someone help me with this:

How can I do a "redirect-action" to some action from within ActionSupport ?

I want to write an ActionSupport class that will insert some data in the DB and if succeeds , I want to redirect to some action set in this ActionSupport ( an action name, as String, is provided in this ActionSupport class ) and if not, just go to error.jsp

Can this be done, and how would I map this action in a strut.xml file ?

something like this:

14 years ago
Yes, it is Struts2...
Anyway, thanks for your answer.

Consider this done.
I'll make a map in a session, and assign a list to it's concrete MyActionSupport so that every instance of this class overwrites only it's list...
14 years ago
Sagar Rohankar, thanks a lot for your time and answer!

I know that this is one of the good solutions, but here is the thing:

In my application I use my custom ActionSupport class "MyActionSupport" that extends ActionSupport and allways uses this list ( currently from session ).
MyActionSupport almost always needs this list in order to manipulate some DB data properly.

And every ActionClass in my application that is of type "MyActionSupport" uses different instance of "MyList".
Sometimes it is a list of 4 elements , sometimes it's a list of 10 elements, and so on...
It depends which DB table I am processing with it...

So, If a user opens a tab in the browser to work with employees table, for example, he is going to need a list of 10 objects, each with it's properties set to some values.
At the same time, in another tab of the browser, he opens an application and work around with sales table, and for that MyActionSupport class uses a list of , for example, 20 objects, each with it's properties set to some other values than the ones in list for employees...

So, we have two different lists that needs to be set in the session or somewhere else.

At this moment, on execute() , MyActionSupport allways rewrites the current list in the session and sets it's value with the one in itself.

So, this is a problem...
I hope I explained it a little better...
Is there some other solution for passing a list of objects between two action classes ove a view ( some .jsp page )?

Hmmm... I already see myself putting this list in a map ( HashMap<String,ArrayList><MyObject>> , where the key is the name of the instance of the action that set the list, and the value is the list that this action contains... ) so that every action class uses it's own list...
In your opinion, would this be a good solution...?

14 years ago