• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 and dojo plugin very slow

 
Juan Manuel
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have an application where I have the dojo plugin to use its autocompleter and datetimepicker tags. The application in localhost works fine but when I install it in a server it takes several minutes to load the forms with these tags. I've read some things about this but I don't know if what I've read it's from previous versions or if these issues in performance still happen. So I've read something about making the dojo plugin lighter deleting static and not use parts of the plugin but I don't know exactly what I can delete without making the plugin not work
Anyone could help me?
This is the code I'm using

Thank you
 
Juan Manuel
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've found the application doesn't even want the <%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
I've tried deleting all my calls to dojo but it didn't work. I had to delete also the taglib to get it working
By the way, I'm using tomcat 6 for this. Is there any problem with it?
Thank you
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Juan Manuel wrote:I've found the application doesn't even want the <%@ taglib prefix="sx" uri="/struts-dojo-tags"%>

I'm not sure what that means.

In any case, no, there are no Tomcat-specific problems. If it's fine locally but not on the server I'd start there--what's different with the server configuration? What's different with the Dojo you're serving?

All that said, there are reasons the Dojo tags were deprecated!
 
Joe Ess
Bartender
Posts: 9297
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at our Enterprise Performance FAQ for how to track down bottlenecks. Remember if you have a small performance problem with your server, AJAX will multiply that problem because it's making numerous round trips to the server for a single page.
 
Juan Manuel
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wrong about the taglib import. It's not that, it's the <sx:head />. When I put this in a page, without doing anything else about ajax (not calling a single <sx:> tag) it just doesn't run the page you are calling for. I don't know why is this but I guess the only thing I can do is rewrite my code because I'm running out of time and if the dojo plugin doesn't work just calling for it I have no other choice
By the way, I'm using struts 2.1.8, maybe that's the reason why dojo plugin doesn't work
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"It just doesn't run the page" isn't enough to begin to be able to help. The plugin works; we're using it in production right now. We're going to *stop* using the plugin.

If you want any further assistance, you'll have to post more details.
 
Juan Manuel
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is that when you try to get to the page where I'm using dojo plugin, it just take, I don't know, 10 or 15 minutes to load it. If I remove the tag <sx:head /> from the head of the jsp, it loads correctly but without dojo capabilities. If I remove all <sx:...> tags from the jsp but still leave the <sx:head /> where it should be, the page still takes an eternity to load. The two tags I'm using rigth now are <sx:autocompleter> and <sx:datetimepicker>. The code I use for the datetimepicker is this


I'm using struts 2.1.8 and I've tried this in my computer and it works fine so I decided to put in a server to try it. In the server it works also fine if you access the application through it but if you access it through another computer it happens what I mentioned earlier
So, another question that I realize know of. This server uses a firewall and it has opened a port to get access to tomcat, configured also with this port. Is it possible that the firewall is doing something I don't know?I don't know about this stuff and I don't know of anything I can try something to be sure. I know if a computer in the intranet try to get to the application through an internal ip it works but if you try through the ip you have to use outside the intranet it doesn't work
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure it's possible the firewall is doing something--it's impossible for me to know. The default Dojo build is relatively large--try using Firebug to time the page load to see where the time is going. Then start figuring out the actual path on the wire that files are being served from.
 
Eugene Williams
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We're going to *stop* using the plugin


I've read in many places that DOJO, being no longer supported, is, in essence, outphased. With that in mind, what is the best-practice method of doing this (creating an autocompleter) without the use of the plug-in? I've thought of writing a method within my action that generates a HashMap (JSON-formated) object within the bean, but wasn't sure about performance issues. Another option I thought of was to write an Ajax powered Javascript method that reads the keystroke within the text field, performs a background query and returns a list of results populated in a dropdown div.

Any ideas as to what method is best? Either of these? None of these?

Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just use whatever JavaScript framework/widget kit I'm using and do it normally. The Struts 2 side doesn't care how it's getting the request, the client side doesn't care how the back end creates its data. The JSON plugin is handy, but it can also be created via JSP, written directly to the response, whatever.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic