?
Solved

not able update the data into the database

Posted on 2014-04-30
2
Medium Priority
?
189 Views
Last Modified: 2014-05-03
Not able to update the record in the database using edit controller
I need to edit description from  particular code

getting error

org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'code' is not present

Open in new window


@RequestMapping(value = "/editRights")
			public String editrights(
					HttpServletRequest request,
					HttpServletResponse response,
					@RequestParam("code") String code, 
					@RequestParam("Description") String Strname,
					HttpSession session,
					Model model) {
				
				

				List<Rights> groups = new ArrayList<Rigsht>();
				Rights right = null;
				EntityManager em = ToplinkUtil.getViewableEntityManager( request, "owner" );
				
				try {
					Right1 = Rights.findAll(em);
					right= em.find(Right.class, code);
					em.refresh(code);
					
					model.addAttribute("code", code);
					
			
					return "user/mainGroups";
				} catch (Exception e) {
					return "failure";
				} finally {
					em.close();
				}
			}

Open in new window


find all method

public static List<Rights> findAll( EntityManager em ) {
    List<WebdUserGroup> results = em.createQuery( "select distinct wug from Rights wug order by wug.code" ).getResultList();
    return results;
  }

Open in new window

0
Comment
Question by:roy_sanu
[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
2 Comments
 
LVL 8

Accepted Solution

by:
Ganapathi earned 1000 total points
ID: 40031371
There is no request parameter of type "String" with name @RequestParam("code") to bind to variable code.

You must be missing "code" in the request. Check for spelling/case.
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 1000 total points
ID: 40031756
List<Rights> groups = new ArrayList<Rigsht>();

Open in new window


The code you posted won't actually compile, for the above reason alone
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 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