How to get this javascript snippet working for me?
-
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 http://xkcd.com/627/ have failed me. Thanks in advance.
-
Answer:
That isn't javascript; it's JSP. Do you guys have the same java environment set up on both machines?
Tooty McTootsalot at Ask.Metafilter.Com Visit the source
Other answers
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.
Citrus
Looks like you're losing the parameters on the Redirect. What framework are you using?
Civil_Disobedient
Ah, in fact we did not. The versions we had were slightly different, and updating to his version solved the problem.
Tooty McTootsalot
Related Q & A:
- How to get JavaScript value in PHP?Best solution by Stack Overflow
- How to get Javascript array length?Best solution by Stack Overflow
- How to get the file using it's URL in Javascript?Best solution by befused.com
- How to get current YouTube video url using JavaScript?Best solution by Stack Overflow
- How to get my digestive system working again?Best solution by sheknows.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.