Load an applet in subfolder - applet

I have an applet in the root directory of my website and the applet is used on pages in the root directory and subfolders.
When I open a page of the applet in the root directory it works perfectly. But after I open the page of the subfolder fails to open the applet.
The same thing happens if I open the first page of the subfolder and then the root directory page. The page fault is always the second to open.
Sorry for my English. This was translated by google

Add the codebase='/' attribute/value pair to the applet to ensure the JRE always looks for the Jar relative to the root of the site. It is the same principle with loading scripts, styles or images into web pages, so it is something you'll need to figure out for web development!

Related

Ionic serve command resets the index.html page

I've recently started developing in Ionic, and I find that once I've made changes to the index.html file and run it (ionic serve), it resets the index.html file.
I think I might be missing a step somewhere, any ideas?
Found the error. I was editing the file in the www folder and not the one in the src folder. Once I updated the index.html file in the src folder, the changes appear in the file in the www folder.
However, I find that when I update the controllers in the src/js folder, they are not updated in the www/js folder, so I have to make updates to the files in the www/js folder.
Not really sure of what's going on.
src folder is true development folder.
When ionic builds the app for you it automatically copies all the required files from src/ to www/.
If its not happening there might be something wrong with project, try removing and adding platform again.

Add external html and css file in a servlets project created in eclipse

I have a servlets project called LoginPortal. In this project, I intend to add an html called login.html and a css file called login.css . I added them to Webcontent folder which is where I added other html files that I created in project it self.
Besides login.html and login.css, all other files were created n the project only and so work just fine.
The directory structure now looks like this:
However , I still get 404 error when I try to access this html file added externally :
URL :http://localhost:8080/LoginPortal/login.html
What could be the possible reasons ?
Eclipse seems to maintain a list of files which it will be deploy to target server when changed.
Since, you added those files externally and eclipse does not know about them yet, it will not deploy this files when changed.
You can do this. after adding this files externally go to eclipse project explorer. Refresh your project from your context menu(Right click -> refresh). This will include the file you added and get listed.
The files will be added instantly when ever there is a changes, and is reflected in the output.

How to use root relative path with Eclipse Http Preview server

I have Static Web project in Eclipse and using Http Preview server for development. I want to use root relative path in my resources (e.g. /css/style.css) but I can't figure out how to configure that server to work. There always needs to be context root in path (e.g. http://localhost:8080/myapp). Context root can't be configured as empty. Is there any option I'm missing?
I have found a workaround for this problem if you are working on a Unix variant. It relies on symbolic links, so it probably cannot be made to work on Windows. I claim no points for elegance, but it does seem to work for me on Ubuntu.
First, you create a new static web project in Eclipse that will contain a link to the resource directory. In this case, you can call the project css. Alternatively, give it a descriptive name, and change the context root to css using the project properties dialog.
In a terminal window, change to the project directory for the newly created project. Probably something like ~/workspace/css/. Then replace the WebContent directory with an appropriate symlink:
cd ~/workspace/css
rmdir WebContent
ln -s ../myproject/WebContent/css WebContent
Now return to Eclipse and refresh the css project. You should now see all of your css files in the project explorer.
Run the css project and the original project on the HTTP preview server.
You will have to repeat this process for each of the top-level resource directories.

Tomcat 7 not setup properly in Eclipse Juno

I downloaded the 32-bit Windows zip from Apache's website.
Then I extracted the contents and placed it in my Program Files folder where Eclipse's extract is also present.
Then I fired up Eclipse, used the Servers tab to set up the server, started it.
I get this:
However when I try http://localhost:8080 in Chrome, I get the 404 error.
Where did I go wrong ?
Your setup does work. Tomcat does work. The 404 you see is given by tomcat.
Only problem, you didn't put any index file... your servlet container needs some content!
Even i m facing the same problem discussed above. I am unable to run any app including servlet application with index file.
I found the below mentioned information in some website..
"Eclipse forgets to copy the default apps (ROOT, examples, etc.) when it creates a Tomcat folder inside the Eclipse workspace. Go to C:\apache-tomcat-7.0.34\webapps, R-click on the ROOT folder and copy it. Then go to your Eclipse workspace, go to the .metadata folder, and search for "wtpwebapps". You should find something like your-eclipse-workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps (or .../tmp1/wtpwebapps if you already had another server registered in Eclipse). Go to the wtpwebapps folder, R-click, and paste ROOT (say "yes" if asked if you want to merge/replace folders/files). "
But the problem is the temp0 folder is empty and i m unable to find the the deploy path ie wtpwebapps. If anyone has come across the same problem and come out with a solution pls let me know..

netbeans ftp configuration

I've set up my FTP connection for my project, but when it uploads the file, it adds a directory named after the project to the uploads (which means it isn't going to the right folder).
i.e.
initial directory set to '/httpdocs';
no upload directory specified.
I upload a file from my local folder:
project name/library/script.php
I want it to go here:
FTP/httpdocs/library/script.php
but it's going here:
FTP/httpdocs/PROJECTNAME/library/script.php
Can anyone help me get this configured correctly?
Then you are making your project in netbeans one folder too high. The project should be created with the main folder being the root folder, not the folder that holds the root folder (the one with the name of the folder).
So, you need to recreate your project with the correct folder being the root folder, and you should be all set.