Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Juan Acv

Greenhorn
+ Follow
since Apr 02, 2010
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 Juan Acv

Ok, i am stupid.

I have the option "create table if doesn't exits" on, and it overwrite all the data with the default data...

Thanks for your tip.
Could you give me an example, please?

I used to recover a list, i am not very skilled on hibernate.

P.D. I am not using the key of the table, i am using a unique field, a "foreign key",
Hello everybody:

I added a ServletContextListener to my struts 2 application, where I do a crud against a mysql database.

This ServletContextListener recover a bean from the applicationContext.xml, a manager to access to database, and store some data realted to the user who is logging if this data doesn't exits, so i read and check if this data exists.

I write this finder:

The listener:



The manager:




The finder:


My problem is, when there is some data associated to a user, it does't recover anything, said that the list is empty, and overwrite the data with the default parameters.

When the application is in, after logging, there is no problem recovering the data.

What I am doing wrong?

Thank you.
2.1.8

I use appfuse framework.
10 years ago
I have replaced #application with #attr, and it works. But I don't understand, reading struts 2 docs, #application should work.
10 years ago
Hello again:

I have a jsp code like this:



Where I populate a select from the a ServletContext attribute:




Sometimes, I found a message like "Caught an exception while evaluating expression '#application.types": java.lang.NullPointException"

I don't know what i am doing wrong (i copied the code from a struts 2 manual )

Any clue?

I also tried #application['types'], and still nothing.

Thanks.
10 years ago
The method update() returns SUCCESS, yes.

I have read to use an action to access the form, an other to update.

It looks like it works, but now, I have this problem:



#application.types should populate a select tag, and it comes from a listener (I have read the example from Struts 2 Design and Programming: A Tutorial ) but it looks like it can't find it.

Maybe I shoud use #application['types']?

Thanks.
10 years ago
Hello everybody.

I have implemented an action with a "prepare()" "update()" and a "validate()" method in Struts 2.

I have mapped it like:

applicationContext.xml





I can execute the action, but the methods are called in this order (prepare() - validate() - update() ) and then, it makes thre redirect to my mainMenu, without stop and watch the jsp.

What i'm doing wrong?

Cheers.
10 years ago
Maybe it's the name:

The name of the file must be ActionClass-validation.xml, where ActionClass is the name of the action class must be validate, and must be in the same directory.

Maybe, is some issue in the interceptors.

Sorry, but i am very new too in struts 2.

Greetings
10 years ago
Hello everybody.

I need to use a optiontransferselect tag, to assign a group list to a user. I need to prepopulate it with data from a database.

My question is, can i use the prepare() method to recover the lists, and then, assign them to a optiontransferselect ?

Eg:



Is there any good example? I haven't found

Thanks.
10 years ago
Hello everybody.

I'm trying to save some data related to an user in a database when login, using a spring-hibernate manager. I am using a class that implements HttpSessionAttributeListener, to add the data, and to increment a users connected counter:


The method returns an error:



Even the program never reach the method getClientData() in the UserDataManager (it isn't appear in the log)

What i am doing wrong? May be, it's not possible to access to a spring-hibernate manager from a Listener?

thank you.
10 years ago
After loosing my job, i have been very stressed, into a mess, trying to do this project, that it's very important to me. I have had to learn everything i thought i have learned yet about spring + hibernate, reading lot of documentation, etc...

I have been trying to translate a struts 1 application into struts 2 as quick as i could, instead of being patient and learn struts 2 starting with the basics.

I'm sorry to cause you so much trouble.

Thanks a lot.
10 years ago
I am using appfuse framework, it works with struts version 2.1.8, and, yes, i believe they use extension-less mapping, reading their tutorial:

http://appfuse.org/display/APF/Using+Struts+2


Thank you very much, you have saved my life (seriously)

Greetings.



10 years ago
So, i return to my first question:

I can have a refresh() method, map it:



and submit the action in javascript:



no?

Maybe i need a lot of examples about how to bind actions with jsp.

Like i said, i will take a look to the tutorial

Greetings.
10 years ago