Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Jorge Baroudi

Greenhorn
+ Follow
since Nov 01, 2005
Jorge likes ...
jQuery Ruby Windows
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 Jorge Baroudi

Hi, hope you can help me out with some Grails problem.

I have a domain based in FDD project management model, something like this:

Project hasMany SubjectAreas
SubjectArea hasMany BusinessActivities
BusinessActivity hasMany Features

(Note: I'm using Subject Area instead of Major Feature Set as it had been discussed at www.featuredrivendevelopment.com forums By Mr. De Luca)

After executing "grails generate-all" command over all domain model classes i have a pretty and functional web site with all CRUD operations for all classes (but you all know grails does that!, don't you?)...

i'm just having one little detail, after having code generated, i start adding a project and i have the "Add Subject Area" link in the Edit project page, i follow the link and add several subject areas for the project (project is selected in one dropdown), If i select the Edit Subject Area button i don't have an "Add business activity" link, i know this is easy to implement, i just think it is important to mention it, maybe is part of a problem in my domain classes, altought, i have constraints and belongsTo [Project, SubjectArea] relation.

But my real problem starts when i go to add a business activity for a newly created subject area.

in Create and Edit Business Activity pages, i can select a project with Subject Areas of other project, so i'm looking to do an onchange event filter 'cause they won't get filtered after a simple code generation.

Can i have the aforementioned filter for dropdowns right after a code generation using some sort of constraint or other stuff?.

If code generation doesn't make something like child-dropdown-filter-from-parent-onchange-event then, what do you think is a good strategy to do this? is there an example of this cascading Dropdowns
feature?

Thanks in advance.
13 years ago
ah, netbeans vs eclipse, that is the question...

Found this, maybe you would like to check it out, it follows up a very interesting conversation about netbeans popularity.

http://blogs.ebusiness-apps.com/dave/?p=111

regards.

PS. long live netbeans, but is good to have eclipse too.
Gracias Stefan!!!

It worked perfectly!

What was happening? what was i storing in the arrayNewspapers ArrayList variable? i checked the tomcat generated servlet for the jsp file and... well, i did a lot of things and it resulted to be the easiest one

i tried to retrieve within a scriptlet the pageContext to cast the news variable (from the forEach tag) but nothing worked... oh well... i'm happy now, and my code looks "scriptlessly" fine thanks to you Stefan.

PS. Gracias!!! is Spanish for Thank you!!!

Now i have to face a much serious problem... paging with SQL server... now that is a problem! hehehehe.

Thousand thanks!

${mytags: DisplayJumpingHappyBeanGeorge()}
^----- Note: That is definitively not the method name... check the DD file
^----- The ${mytags: Dis... space is left intentionally

Regards.
[ January 30, 2006: Message edited by: Jorge Baroudi ]
14 years ago
JSP
Yes i was thinking in a redirection like you said (public ArrayList getList(){return this.getList(null);} ) to try the ${newsRules.list} effect, and i'll put the value within the c:set tag to see if it works better.

i'll be back to you in, say 10 minutes

Thanks for your reply Stefan
14 years ago
JSP
Thanks for the reply Stefan, i'm going to put some code to be more specific:



I appreciate any help on this issue

George.
[ January 30, 2006: Message edited by: Jorge Baroudi ]
14 years ago
JSP
Hi!

I have the same problem, i need to cast to the specific entity type to retrieve several (bean) properties, and when i try to do it directly using EL (for example ${item.name}, item is from var="item" of a <c:forEach ..> tag) there is a javax.servlet.jsp.el.ELException: Unable to find a value for "name" in object of class "java.lang.String" using operator ".", but i'm storing the objects like this:

In my class method i do something like this:

<!-- Java Code -->
// initialization of the item
MyItem item = null;

// rs is of type ResultSet previously populated by a query
while( rs.next )
{
item = new MyItem( );
item.setName( rs.getString("name") );
// an array of type ArrayList
array.add( item );
}

<!-- End of Java Code -->

I run a test within main method of the class method (called getList()) and it all worked fine...

I retrieve that list in a jspf file (i don't think there's a problem there), didn't use a servlet as a controller because i had to add the call in every controller so i decided to put the code in the view directly (something just to be practical, despite breaking a little MVC rule ).

And well, what else, i overrided the toString method but the first value appears with a [... and the last value with a ..] so i really thought of the casting as a solution.

May i have a hint from you guys of where should i look for the values of MyItems objects ?

Thousand thanks for your atention.

George Baroudi.
[ January 30, 2006: Message edited by: Jorge Baroudi ]
14 years ago
JSP
Got it running and working...

Finally...

So, heres where i got some few ideas

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

Even though i used the SwingWorker class i had to open more threads in order to acomplish the right behavior, not just to open the server but to accept client connections too...

the code looks like this:



So, If someone was thinking how to do it, hope this is helpful.

Regards.

P.S. Forgot to say that there was another place where i got many more ideas... http://www.javaranch.com
Okey, now, i have read the "HowToAskQuestionsOnJavaRanch!" and hopefully you'll see that what i'm asking is not quite how to code it but some few ideas on how to actually manage the whole concept, wich is, the client socket of a messaging server with one subclass that handles the message receiving service.

This is not the part that the teacher wants, its just the first part, and im contributing to give the tool for all my schoolmates, actually, the important part for him will be the swing view of the cellphone

So my questions where related not actually to the homework but the Threading part of the server for all the clients (in this case, cellphones).

One good example is Deitel's NonBlockingMessengerCaseStudy wich implements a chat but i don't wnat that everyone gets the message just the specific client address by a telephone wich i save when they register the first time (method registrarCliente) in the server in an ArrayList of Client class (a class with properties name, telephone, ip address and port).

Finally, the idea of some test is coming after reading the whole forum and do some googling... i will try to test some late creation of the server that receives messages in the clients... still, don't know if this is okey, i believe it should be a little easier than that... so after registering the client with the message server, the client itself will have to establish its own server, therefore, i will have the registered client in the server and the client running, as simple as that...

So Late Server Creation... in order to let the client register first without the threading problem i have already...

I'll let you know what happened !

P.S. Yes i'm a newbie in Threads but hopefully i'll get this done before the semester finish

Regards
Hi everybody!

"Desperate SchoolWorkingGuy" wrote:

Altough this question is related to my homework i want to ask you something simple, yet, very important for me to understand, I have to implement a Message server for Swing-like cell phones, wich everyone in my class will have to design according to their own cellphones, but just the messagin' service part.

The question is about the client and server and the way the client can receive messages "at the same time" its comunicating to the server to send messages too.

Let me make myself clearer...

/*** STARTS JAVA CODE ***/

/*** ENDS JAVA CODE ***/

This is the Client-Server, i have no problem with the client side, it connects perfectly to the server and registers its telephone ( method registrarCliente ) wich is saved in an ArrayList, and also i can connect and get a list of all the client connected ( method listarClientes ). The problem is when i add a server... if you check my constructor, i have a an instance of the inner class Conexion

conexion = new Conexion( this.socketCliente, this.puertoServidorLocal );

but after starting it, the client can't keep with the registration process ( again the "registrarCliente" method ). All i see in the server is that a client is trying to connect and i believe then the server part of the client ( the above code ) is started due to the threading and because i have a while ( true ) it stays there waiting to receive messages...

So in conclusion, my questions are,

1) Can i have the server and client part in the above code like i'm trying to do it?

2) If it is so, how can i manage both?

3) should i take away the while ( true ) from the client-server side?, but then how do i manage to handle several messages... well, there will be only one client for my client-server code wich is the message server.

If i haven't make myself clear please let me know so.

Many thanks in advance for your help.

P.S. Feel free to ask all you want about translation to English from my Spanish code

[ November 15, 2005: Message edited by: Jorge Baroudi ]

[ November 15, 2005: Message edited by: Jorge Baroudi ]
[ November 15, 2005: Message edited by: Jorge Baroudi ]
Hi peter, if you're refering to the validation you make with the deploytool i got the same error, altought i just keep going and deploy it anyway, finally check my Advice client app and got it running, i believe its because you don't include in the client.jar the ejb classes, but that's the whole idea i think.

Anyway, try and deploy it and check if the error appears at execution time.

Oh! and in advance i give you two more tips for the AdviceGuy example:

1) Go to wickedlysmart.com and check the errata of the book, for example there is this mehotd of getAdvice from the Advice component that should be named diferent say getTheMessage.

2) My other tip is that if you're getting a CORBA exception, someting related to a host not found, check if you're connected to your local network, if you need to test your ejbs without the local network connection then you could change the target server in the domain\config\sun-acc.xml file to localhost in order to stop getting the error.

So, that is all i remember, i just lov'd the book, still getting a lot of problems, but i'm a newbie anyway, on my way to solve all those little problems

Regards.
[ November 12, 2005: Message edited by: Jorge Baroudi ]