Org.apache.struts Cannot Be Resolved Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this org.apache.struts.action jar site About Us Learn more about Stack Overflow the company Business Learn package org apache struts action does not exist netbeans more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question actionform cannot be resolved to a type x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “The
Struts.jar Download
Import cannot be resolved” error when using the jar I created up vote 0 down vote favorite I am using struts1.2 and junit 3. In order to test my action classes, I need to create HttpServletRequest objects. Now Struts 1.2 has does not provide a way to create mock objects of HTTPServletRequest. However, Struts1.3 has MockHttpServletRequest.class, with which you can mock the HTTPServletRequest. It's not an option to upgrade from Struts 1.2 to Struts 1.3 at the moment. So what I did was create a jar file out of the mock package in Struts 1.3 and added it to my project. Eclipse content tool does see the MockHttpServletRequest class, ie if I type "Mockhtt" and press CTRL+space, eclipse completes the class name for me and adds the import statement as well. But after I create the HTTPServletRequest object, eclipse gives an error saying "The import org.apache.struts.mock cannot be resolved". What can I do to get around this error? I need to mock the HTTPServletRequest. java unit-testing jar mocking struts share|improve this question asked Jan 18 '13 at 22:15 Susie 2,59932958 2 This is not a good idea. Instead, why don't you look into using EasyMock or Mockito? I personally use EasyMock in nearly every unit test I write to mock HttpServletRequests. –ninnemannk Jan 18 '13 at 22:18 2 Have you tried a clean project? When eclipse is upset, that sometimes helps. –flup Jan 18 '13 at 22:21 I am using Mockito.. but can you give me an example o
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million http://stackoverflow.com/questions/14408544/the-import-cannot-be-resolved-error-when-using-the-jar-i-created programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Dependencies are not imported in project up vote 1 down vote favorite I am using maven with eclipse I have struts and java ee dependencies in pom.xml Here is my sample pom.xml
This Site Careers Other all forums Forum: Struts The import org.apache.struts cannot be resolved (ActionForm cannot https://www.experts-exchange.com/questions/21738861/import-org-apache-struts-action-ActionForm.html be resolved to a type) Rakesh Rajmohan Greenhorn Posts: 22 posted 7 years ago Hello.. cannot be When I run my web application from Eclipse, I get the above error. (But I have all library/.jar files needed, including struts.jar in my 'Web App Libraries' of Eclipse). Not sure cannot be resolved what exactly is the problem. I get exception the org.apache.jasper.JasperException: Exception in JSP: /loginPage.jsp:48 48:
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > import org.apache.struts.action.ActionForm Want to Advertise Here? Solved import org.apache.struts.action.ActionForm Posted on 2006-02-15 Java 1 Verified Solution 5 Comments 744 Views Last Modified: 2013-11-23 I am getting compile errors while compiling a struts program at the following statements import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; I am not aware where from can I download this package of Action, ActionForm, ActionForward and ActionMapping. 0 Question by:rmvprasad Facebook Twitter LinkedIn Google LVL 6 Best Solution byavinthm you dont have struts.jar in your classpath. download the latest struts zip file from the apache link. When you unzip this, u will find struts.jar in it. add strusts.jar file path to classpath entry Go to Solution 5 Comments LVL 6 Overall: Level 6 Java 3 Message Expert Comment by:avinthm2006-02-15 hi rmvprasad, all these classes are packaged in struts.jar, you dont have to download anything extra. 0 LVL 10 Overall: Level 10 Java 6 Message Expert Comment by:radarsh2006-02-15 http://struts.apache.org/download.cgi ________ radarsh 0 Message Author Comment by:rmvprasad2006-02-16 I am getting the following errors WEB-INF\src\com\jamesholmes\minihr\SearchAction.java:8: package org.apache.strut s.action does not exist import org.apache.struts.action.Action; ^ WEB-INF\src\com\jamesholmes\minihr\SearchAction.java:9: package org.apache.strut s.action does not exist import org.apache.struts.action.ActionForm; ^ WEB-INF\src\com\jamesholmes\minihr\SearchAction.java:10: package org.apache.stru ts.action does not exist import org.apache.struts.action.ActionForward; ^ WEB-INF\src\com\jamesholmes\minihr\SearchAction.java:11: package org.apache.stru ts.action does not exist import org.apache.struts.action.ActionMapping; ^ WEB-INF\src\com\jamesholmes\minihr\SearchAction.java:13: cannot resolve symbol symbol : class Action location: class com.jameshol