Solved

package shows as folder, subfolder

Posted on 2013-10-22
5
296 Views
Last Modified: 2013-11-22
hi,

I am trying below example on my other machine.

http://www.srccodes.com/p/article/24/spring-3-mvc-framework-based-hello-world-web-application-example-using-maven-eclipse-ide-and-tomcat-server


when i created
'SpringMVCHelloController.java'
under package
 package com.srccodes.spring.controller;

For me, it is showing folder structure and then sub folder structure as attached where as in the link package structure for the author looks different without any folders. Am i doing anything wrong. I just created'SpringMVCHelloController.java'
 file in default package  then created the package and then moved it to
package com.srccodes.spring.controller;
please advise
Any links resources ideas highly appreciated. Thanks in advance
Str2.jpg
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39592757
Look at your screenshot again.... you have your Java file in the package folders under "src/main/resources" whereas it should be under "src/main/java".

When you create a new class (via the "New Class Wizard") the very first input box asks you for the source folder location, make sure this specifies the location as above, ie. java folder not resources folder. Also, rather than creating it in the default package and then moving it, you can specify the package where you want your class created in the 2nd input box in the New Class wizard page.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39609763
what is the difference between 'Source folder' and 'package folder'. why we need both of them. Both seems same to me. please advise
0
 
LVL 35

Expert Comment

by:mccarl
ID: 39610429
By "package" folders I was just referring to the folders "com", "srccodes", "spring", and "controller" that are in your screenshot, ie. the folder hierarchy that makes up your package structure. There really is NO difference between what I was calling "source" folders and "package" folders, they are both "source" folders because they contain "source" code. I just said package folders to be specific that the ones that I was referring to were specifically related to the package structure.

Anyway, all of that is irrelevant to your original question. Were you able to create the SpringMVCHelloController.java file in the correct place and get the same view as the author of the tutorial?
0
 
LVL 7

Author Comment

by:gudii9
ID: 39610665
I have not got chance to try. I will try and let you know soon
0
 
LVL 7

Author Comment

by:gudii9
ID: 39636171
I am still having issues in running this example. Will try on other machine and let you know
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What's wrong with this code? 4 46
running on tomcat not jboss eap 7.0 3 53
Strange router problem - can't access hotmail.com 14 108
Bitwise and to sum elements 2 53
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question