Files not executing in any browser except IE - java

I am doing a simple dynamic web project in eclipse Luna with a set of JSP files and Tomcat web server. But problem is, whenever I run any of the JSP files, it gives an error "File name, directory name or volume label syntax is incorrect" on all browsers except IE. I have searched a lot for this but I only got answers for maven projects. Can someone please provide a simpler solution ? Thanks in advance

Solved : We just need to change the settings in Window > Preferences > General > Web Browser and click on new and add our own browser(FF or chrome) by giving its file path. Then it works.

Related

Why Tomcat works fine when I put a .jsp but with a .html doesn't works?

I'm working with eclipse and I created a project, I put a test.html and test.jsp file in the root folder. In the URL of the Google Chrome I put this:
http://localhost:8080/project/test.html Error 404
http://localhost:8080/project/test.jsp Works (hello world!)
What is happening?
Double check if your test.html exists under this path:
"Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\project"
If exists, then it should be accessed normally, if not then you have to clean/build your application correctly or even try to restart eclipse.
Based on your follow-up comments about the custom Tomcat install and the project error message, it sounds like you either don't have Eclipse properly configured to use your Tomcat server, or you don't have your project associated with the Tomcat server you've set up, and so perhaps your changes arent being deployed properly. See if that issue has a quick fix suggestion (right click it) or go through your project settings and verify your selected server runtime. Sorry on phone can't give specific instructions.

Updated Jsp Is Not Being Translated Into Java File In iplanet Web Server

I am new to an iPlanet web server. There is a requirement for my project: I need to debug it by placing: <%System.out.println("this working fine Kind of messages"+a);%>.
I have updated some part of my JSP to debug whether the corresponding values are being populated from back-end application correct or not. When I placed JSP and run an application from the browser, I'm getting a blank page, which means it is not translated properly. I checked and restarted the server as well, but I'm still facing the same issue and the .java is generated fine, but without content in it. Please suggest any right direction.
I have resolved this issue, after lots of experimenting like.
tried deleting particular generated .java file, did not solve that issue. but
path of generated folder were /generated/org/apache/jsp/*.java and their corresponding *.class, came till /generated/ dir and took backup of existing org dir and deleted it. once again I tried hitting URL on a browser to get that particular JSP result,I glad to see that my sysout are printing over webserver's console.
overall My suggestion is just to delete that generated *.java and *.class files iPlanet will regenerate whenever you request it.

unable to find servlet(.java) files converted from jsp

I am using eclipse luna and tomcat version 7. I have written few jsp files and executing them on tomcat easily. I have read that jsps are converted into servlets at run time and you can locate them in tomcat/work/catalina/localhost/project name and further. My project name is quizilla and there exist a folder named quizilla-1.0-SNAPSHOT, but this folder is empty. What is the reason and where can i find those .java files. I have attached the screen shot of the folder as wellAs I am in right directory in search of my java files, but the folder is empty. So what should i do
You are using Tomcat from Eclipse, so the work directory is:
projectworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
or something like that (if you haven't changed the Server configuration via Eclipse).
Add
<%=getClass().getResource(getClass().getSimpleName() + ".class")%>
to one of your JSP pages to detect where Tomcat has generated the servlet.

Cannot run/debug jsp page from within IntelliJ using Tomcat server

I created a new project and created artifact for it.
When I run Tomcat from command prompt and go to: http://localhost:8080/IntelProject1/index.jsp
I can see my page.
But when I try to run it from IntelliJ, it opens empty page:
http://localhost:8080
and if I try to go to:
http://localhost:8080/IntelProject1/index.jsp
this is what it displays:
HTTP Status 404 - /IntelProject1/index.jsp
type Status report
message /IntelProject1/index.jsp
description The requested resource is not available.
Apache Tomcat/7.0.57
The reason it is able to find it from tomcat is because I edited server.xml file in tomcat/conf folder:
<Context path="/IntelProject1" docBase="C:\Users\ibogojevic\Desktop\IntelProject1\web\JSP" />
But I want to be able to open it and debug from within IntelliJ
Maybe my artifact is wrong.
Any thoughts?
Open Debug Configuration in IntelliJ IDEA and make sure that Deploy applications configured in Tomcat checkbox is checked as it shown on the screenshot.
For me it worked with:
File >Project Structure >Artifacts
In the
Output Layout on the right side >"Available Elements?"
right click on the available libraries ( for me it was "Spring MVC-4.2.4.RELEASE")
Put into Lib
And it worked.

jquery.js doesn't get loaded in Tomcat

OK, so I found out so far, that despite me having the jquery.js file in the same folder as the jsp file I have, the Ecipse-Tomcat configuration is executing the files in a different location and it takes all the files except for jquery.js How is this possible and how I can make it automatically load the file in it execution folder?
In my case jquery refuses to work unless I specifically put it in the folder where tomcat is executing the files... Any ideas? Thanks.
Alright, after a few hours of struggling, I finally found a solution to this problem. Seems Eclipse Tomcat probably isn't refreshing and checking the files in the path well if you're using any other perspective than Java EE. In my case I was using and working all the time in the normal Java perspective and this way it never reloaded even when I would click refresh. Now however I switched to Java EE view and clicked refresh. The file finally appeared and jquery finally started working!
All JS/CSS/HTML files are static resources and would be served from Tomcat through DefaultServlet. You would need to configure the default servlet in your web.xml with appropriate location to the folder where these are present. This has nothing to do with the location of JSP, though the JSPs can also go under the same folder.

Categories