Sunday, 21 February 2016

Eclipse: Missing web.xml file? How can I create web.xml in Eclipse?

Have you created Dynamic Web Project and created servlet and still are you missing web.xml file under \WebContent\WEB-INF\..?
Eclipse allows you to NOT create a web.xml file when you create Dynamic Web Project for Java EE 6, since the Java EE 6 spec (in general) and Servlet 3.0 spec (in particular) attempt to de-emphasize deployment descriptors.
You can use annotation to provide all the data that had been included in the web.xml file. You should read through the Servlet 3.0 spec from the jcp.org site to get a bit more explanatory text.
To change the url-mapping for a Servlet 3.0 servlet, the first place to look is in the source code for the servlet. Look for (and change) the value of the urlPatterns element.
If you are trying to create a web app based on Servlet 3.0, try to avoid creating a web.xml file.
But still if you need web.xml then you can do it by Dynamic Web Project –> RightClick –> Java EE Tools –> Generate Deployment Descriptor Stub.
Java EE Tools and Generate Deployment Descriptor Stubs
You should see web.xml file immediately after that.
Web.xml file for Dynamic Web Project
Now it’s time to deploy project to Tomcat Web Server. Right click on Server and click Add and Remove.
Tomcat Server - Add Remove Project
Then add your recently converted Dynamic Web project to Configured section at right and you should be all set.

Wednesday, 27 January 2016

Can't start Eclipse - Java was started but returned exit code=13 !!! SOLVED

I got this error, and found that my PATH variable (on Windows) was probably changed. First in my PATH was this entry:
C:\ProgramData\Oracle\Java\javapath
..and eclipse ran "C:\ProgramData\Oracle\Java\javapath\javaw" - which gave the error. I suspect that this is something that came along with an installation of Java 8.
I have several java versions installed (6,7 and 8), so I removed that entry from the PATH and tried to restart Eclipse again, which worked fine.

Friday, 16 October 2015

Unable to open .exe files

 Type command in the RUN dialog box to open Command Prompt

2. When Command Prompt is up, type cd \windows
3. Type regedit to open up the Registries.

4. Expand HKEY_CLASSES_ROOT and find the folder of .exe 

5. Without expanding it, on the main .exe folder, Right-click (Default) and Modify. Change the Value Data toexefile
6. Now in the same HKEY_CLASSES_ROOT find the folder of exefile and Right-click (Default) and Modify. Change the Value Data to "%1" %*

7. Lastly expand exefile, expand shell, expand open, click on the command folder, Right-click (Default) andModify. Change the Value Data to "%1" %*

8. Close Regedit and Restart the computer. When restarted, EXE files should not prompt you to choose a program to run it now and load correctly.

Thursday, 27 August 2015

Problem: failed to create task or type nbdeploy?? SOLVED!!

 After a long time , I was testing my project in Java EE but  unfortunately i encountered the following the error: 

Problem: failed to create task or type nbdeploy 
Cause: The name is undefined. 
Action: Check the spelling. 
Action: Check that any custom tasks/types have been declared. 
Action: Check that any / declarations have taken place. 

BUILD FAILED (total time: 2 seconds)  

Then after several futile attempts , I finally get a solution to my problem and it really helped me a lot.

Actually , i disabled the plugins responsible for Java EE and Web related applications .

To enable this , Go to Tools >> Plugins >>Installed Tab >> Check Java Web and EE checkbox.

The problem is solved.

Wednesday, 1 July 2015

List of Alt Codes for entering Greek Letters

ALT Codes for Greek Letters
Alt CodeSymbolDescription
Alt 224αAlpha
Alt 225ßBeta
Alt 226ΓGamma
Alt 235δDelta
Alt 238εEpsilon
Alt 233ΘTheta
Alt 227πPi
Alt 230µMu
Alt 228ΣUppercase Sigma
Alt 229σLowercase sigma
Alt 231τTau
Alt 232ΦUppercase Phi
Alt 237φLowercase Phi
Alt 234ΩOmega

Tuesday, 30 June 2015

Make Your Own Header File ?
Step1 : Type this Code 
  • In this Code write only function definition as you write in General C Program
Step 2 : Save Code
  • Save Above Code with [.h ] Extension .
  • Let name of our header file be myhead [ myhead.h ]
  • Compile Code if required.
Step 3 : Write Main Program
  1. Include Our New Header File .
  2. Instead of writing < myhead.h> use this terminology “myhead.h”
  3. All the Functions defined in the myhead.h header file are now ready for use .
  4. Directly  call function add(); [ Provide proper parameter and take care of return type ]
Note
  1. While running your program precaution to be taken : Both files [ myhead.h and sample.c ] should be in same folder.

Friday, 26 June 2015