This is my project structure imageFileNotFound Ausnahme bei dem Versuch, Bohne von applicationContext.xml
@Controller
public class LoginController{
@RequestMapping(value = "/registerUser.htm", method = RequestMethod.POST)
public String login(@RequestBody String userProfile){
String message = "Hi Im here";
try{
ApplicationContext context = new ClassPathXmlApplicationContext("/WEB-INF/ApplicationContext.xml");
UserProfile userProfile2= (UserProfile)context.getBean("userProfile") ;
System.out.println(message);
}catch(Exception e){
System.out.println(e.getMessage());
}
return message;
}
}
Es löst eine Ausnahme Datei nicht gefunden zu extrahieren. Bitte hilf mir dabei.
Danke, es funktioniert :). Aber warum nicht früher? –
ClassPathXmlApplicationContext sucht nach der Konfigurationsdatei im Klassenpfad. Der Ordner "web-inf" ist jedoch nicht im Klassenpfad enthalten – hasnae