• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

Logic for Code - HELP

hi experts,

Recently one update was asked to add to my JSP: Need help to arrang and get the correct logic for the code:

String SID= ID_line_1
session.setAttribute(SID, 303);

Parameter passed from other jsp look likes this:
Name------------------value
seqs_line_1              ID_line_1
comment_line_1       Student passed


-----------my Code--------

java.util.Enumeration allnames = request.getParameterNames();
while (allnames.hasMoreElements())
{
    String name = (String)allnames.nextElement();  
   
// this 1st if statment does some operation I dont want to change this one but only the 2nd if statment. But I need the seq# from here
    if (name.startsWith("seqs"))
    {
           String ObjName = (String)request.getParameter(name);
       Approval aqc = (Approval) session.getAttribute(ObjName);              
      String[] records_seq =aqc.getPendingSeqs(",").split(",");
            for (int i=0; i<records_seq.length; i++)
              {                
                 out.print("<BR>SEQS:"+records_seq[i]);
              }
     }

// Bascially I'm trying  below if statments to check if "comment_line_1"  has values if so (ie not empty), then it should update DB with correcsponding sequence_id. So this sequence_id is linked with seqs_line_1 value ie "ID_line_1" which is session object. So using session get of ID_line_1 we actualy gets the seq#.

  if (name.startsWith("comment_line"))
    {
          String value = request.getParameter(name);
           if (value != null && value.trim().length() > 0)
        {
             String[] parts = name.split("_");
             String studentId = parts[2];
             out.print("ID_NO:"+studentId );
             out.print("Value:"+value);
        //?? How to get "ID_line_1" value here (ie 303) so that I can do DB changes here
        // ie  for Record# 303, comment is "Student passed"  is to be updated on comment table.
         }
     }
 }  

0
princehyderabad
Asked:
princehyderabad
1 Solution
 
fargoCommented:
//?? How to get "ID_line_1" value here (ie 303) so that I can do DB changes here
// ie  for Record# 303, comment is "Student passed"  is to be updated on comment table.

Not clear man.

Ok. if u wish to get the SID, which is in session..u can simply get it like
session.getAttribute("ID_line_1");



0
 
princehyderabadAuthor Commented:
I got my solution thru other source. I need to delete this question.

thx
PH
0
 
GranModCommented:
Closed, 125 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now