I have 2 java classes and I want to transfer data between them. 

I take user id as parameter in a previous jsp form, and in a java class, using setAttribute I create a atribute named st\_id. 

then in another java clas I want to retrieve this data, but I get null.pointer exception. 

first java file; 

```
public class Signin implements Action {

public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {

    Student stu = new StDAO().getUser(request.getParameter("st_id").toString());
    request.setAttribute("st_id", request.getParameter("st_id").toString());
...

```

second; 

```
public class addCourseStu implements Action{

@Override
public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {
       TakeCourseDAO pf = new TakeCourseDAO();
       String s= (String) request.getAttribute("st_id");

```

So s is null, it's not my intention.