> 
> I am working on **Java EE application** where I want to pass my **selected href
>  value from JSP to a Servlet**. I have 5 links from which i want to pass
>  selected value.
> 
> 
> My **jsp code** is,
> 
> 
> 

```
<a href="selectTopic" name="html">HTML 5</a><br />
                <a href="selectTopic" name="windows">Windows 8</a><br />
                <a href="selectTopic" name="office">MS Office 2013</a><br />
                <a href="selectTopic" name="android">Android</a><br />
                <a href="selectTopic" name="hadoop">Hadoop</a>

```

> 
> which look like this
> 
> 
> 

![enter image description here](https://i.stack.imgur.com/ePaDd.png)

> 
> I have mapped my selectTopic action to the **SelectedTopic.java** servlet
>  class. code is,
> 
> 
> 

```
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String selectedTopic = "";

        selectedTopic = (String)request.getParameter("html");

        System.out.println("selectedTopic = "+selectedTopic);

    }

```

> 
> and the **output** is:
> 
> 
> 

```
selectedTopic = null

```

> 
> My question is,
> 
> 
> 1)Why i am getting null value as i have taken same as we are getting
>  value from any textfield  
> 
>  2)How can i dynamically differentiate and
>  take selected link name (html or windows or android etc) on
>  SelectedTopic.java
> 
> 
>