```
String destinationFile = request.getParameter("destinationFile ");
if (destinationFile == null || "".equals(destinationFile))
 response.sendRedirect("/astro/login/index.jsp?destinationFile =customerLogin.jsp");

```

I have written it as 

```
String destinationFile = request.getParameter("destinationFile ");
response.sendRedirect((destinationFile==null || "".equals(destinationFile)) ? "/astro/login/index.jsp?destinationFile =customerLogin.jsp" : destinationFile);

```

the problem with terinary operator is that what should be placed after : 

In if condition i have not mentioned any else. I have to verify the directory structure should be pre-pended to destinatedFile.