How to get this javascript snippet working for me?
September 22, 2009 10:24 AM   Subscribe

I'm a noob. Tell me why does this snippet of javascript work on my coworker's computer, but not on mine?

I have started helping out a coworker on a project he's working on. The project is a mix of html, struts and javascript, and we're using J Developer for editing. He created the framework, and I've been helping him out here and there setting up pages. He created a page that gets info via a form, which is then tacked onto the url, where it is then used to forward the user to the appropriate page. Simple, right? This works fine on my co-worker's computer, but does not work on mine.

When I've done this in the past, I've parsed the url itself to get the info, but he is able to do it with a line of code:

jsp:forward page="Maps_${param['scale']}_${param['issue']}_${param['maptype']}.jsp" /

Where 'param.scale', 'param.issue', and 'param.maptype' are set on the previous page and are in the url. This works fine on his computer - it displays a page looking something like "Maps_Scale_Issue_Maptype.jsp." On mine, it directs me to: "Maps___.jsp". (i.e. all variables are "") His redirect url is:

http://blah/Project/app/Maps_Forward.action?scale=Scale&issue=Issue&maptype=Maptype&zipcode=&submit=View+Map

Mine is:

http://blah/Project/app/Maps_Forward.action?scale=Scale&issue=Issue&maptype=Maptype&scale=&issue=&maptype=&zipcode=&submit=View+Map

Note the duplicates in my version? But if I manually put in the proper url, it still does not fix the problem.

I've tried this in IE and Firefox. Both work on his, neither work on mine. We are running the exact same project, and are supposed to be using the same version of J Developer. Anybody have any ideas on what could be going wrong? This is not what I normally work on, so I'm pretty new to this, and my GoogleFu and advanced troubleshooting skills have failed me. Thanks in advance.
posted by Tooty McTootsalot to Computers & Internet (4 answers total) 1 user marked this as a favorite
 
Best answer: That isn't javascript; it's JSP. Do you guys have the same java environment set up on both machines?
posted by ook at 11:09 AM on September 22, 2009


It's a JSP, and you're using a framework. Make sure that you're using the same JVM, and you have the same version of the same framework classes in the same place on the machines.

Note: This is happening on the *server*, not the client. So, what browser you're using should be inconsequential.

A good idea would be to keep an eye on the server java log, and look for stack traces.
posted by Citrus at 11:34 AM on September 22, 2009


Looks like you're losing the parameters on the Redirect. What framework are you using?
posted by Civil_Disobedient at 1:17 PM on September 22, 2009


Response by poster: Ah, in fact we did not. The versions we had were slightly different, and updating to his version solved the problem.
posted by Tooty McTootsalot at 1:15 PM on January 25, 2010


« Older Tips on doing a master's degree in a second...   |   Something a little less unweildy than "CĂș... Newer »
This thread is closed to new comments.