manoj samarasinghe

Greenhorn
+ Follow
since Nov 17, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by manoj samarasinghe

hi,

I am using MailLogger for my nightly build for sending a mail with status.
I use something like this,

/vobs/pub/apache-ant-1.6.1/bin/ant -logger org.apache.tools.ant.listener.MailLogger -buildfile /vobs/prof/custom-applications/TBM/nightly_build/call-review.xml -DMailLogger.failure.subject="$failure" -DMailLogger.success.subject="$success" -DMailLogger.properties.file=/vobs/prof/custom-applications/TBM/nightly_build/reviewmail.properties -logfile /vobs/prof/custom-applications/TBM/nightly_build/review-status.log

it works fine.

But i need a way to add one more extra message to the end of the body of the mail i send.

But Content of the mail is taken by the log file ,declared as last line.
(-logfile vobs/prof/custom-applications/TBM/nightly_build/review-status.log)

I cannot add any thing to that file because it is created after each build and overrides preveios information.

Is there any way to add extra information to my mail body (not to mail subject, etc ..)? like MailLogger.message= .

here is my property file i use.

MailLogger.mailhost=
MailLogger.port=25
[email protected]
[email protected]
[email protected]
[email protected]

thanks
manoj.
hi,

In my Struts front end.....

i get a collcetin of data from database and populate a table with them.
Each raw has a radio button associated.when one raw is selected by clicking the radio button and click another button called "edit" will appears a new raw with fields enabling to edit and those fields should alredy populated with corresponding values of the selected raw.

I need a way to identify a raw seperately and populate that newly created raw with those data in that selected raw.

thanks a lot
manoj samarasinghe
waiting for reply................
19 years ago
hi,

I was able to use jaas NTLogin authentication successfully for my project.
For the moment it will ask user for userName & password.

But because user is already login to the matchine (intranet) login again seems unnecessary.

I need a way to use those credentials without login again.
(i found out its callre "Single signOn")

thanks

manoj.
19 years ago
hi,

I tried to use NTLogin module for my JAAS login.
I put NTSystem.dll in right place.
But when i run the program it gives following erroe message


Load NTLibrary..........
Username: msamarasinghe
Password: Tgb5Nhy6
Domain: VIRTUSA
Just before calling ntSystem.logon()
userName manoj
pasword ijnmko
domain SAMPLE
javax.security.auth.login.LoginException: java.lang.UnsatisfiedLinkError: logon
at NTSystem.logon(Native Method)
at NTSystemLogin.login(NTSystemLogin.java:147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.access$000(Unknown Source)
at javax.security.auth.login.LoginContext$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokeModule(Unknown Source)
at javax.security.auth.login.LoginContext.login(Unknown Source)
at JaasTest.main(JaasTest.java:35)



I have no any idea what causes it.
help me

thanks.
manoj
19 years ago
Hi,

i know how to get data from a collection in to a jsp table,using Struts logic:Itrate tag.

but after populating them in a jsp table, i need a way to edit them in the same place (same jsp page )and when a button is clicked save those data in corresponding elements in side the collection.

for the moment those data are not saved proprely. because dont have a way to identify which element is changed and which one is the corresponding element in the collection .

help me

thanks
manoj
19 years ago
Hi,

i am trying to use Windows Authentication for my struts project.
but i am new to that area. I need to restrict some people by accessing
certain jsp pages. And some pages should be allowed only to view but not to edit.How can i restrict different users for view,edit,... for the same page?

I need a way to disable some links in the main page for certain users.(Those who have non administative rights)

please give mea solution or any resources tutorial etc regarding this.

thanks
manoj
19 years ago
JSP
it is TimeZone.getAvailableIDs() method

i am getting timeZone as Asia/Colombo.
19 years ago
hi,

calendar.set(year , month , day , hour , minute , second);
TimeZone timeZone = null;

if ((timezone != null) && (!(timezone.toString().equals(""))))
{
timeZone = TimeZone.getTimeZone(timezone);

if (!timezone.equalsIgnoreCase(timeZone.getID()))
{
String msg = MPWAUtils.getLogMessage(
"error.general.invalid_time");
log.error(msg);
throw new InvalidParameterException(
MPWAConstants.ERRMSG_INVALID_TIME , msg);
}

log.debug("time zone " + timeZone);
calendar.setTimeZone(timeZone);
log.debug("time zone after set in Calendar " + timeZone);
//Generate TimeStamp from Calendar
timeStamp = new Timestamp(calendar.getTime().getTime());




i use above code to check any entered time zone is valid.

i need to check its validity and throw an exception if it is wrong timeZone.

but i dont want the time zone to be converted to default one.

and i need to get all available time zones in the world.

currently TimeZOne.getAvailableZones() will not get all of them\

help me

thanks maoj.
19 years ago
thanks a lot....

solved it....

manoj
20 years ago
hi,

i used Calender object to set valus ..
calendar.set(year,month,day,hour,minute,second);

i set year 2004 12 10...like that..

but after setting those values if i display them again
the year value is changed to 2005 and month to 1(january).... and
other values changed too.

what is the reason for that ?
need a help to get unchanged values form the calendar.
thanks
manoj.
20 years ago
hi

in my program i need to use a xml document as a input to a perticuler class.in that class i need to parse that xml and identify methods and attributes of that class from that xml.

and also i need a way to make all returned values from methods of that class in to a another xml string.

xml string as input-----> class---->identify mehod calls from that xml string---->calling methods---->return values as xml string.

i am expecting more simple solution for this
thanks
manoj samarasinghe
20 years ago
hi

Can we handle more than one action from single jsp page ?
if possible how.

thanks.
20 years ago
IN MY STRUTS PROJECT

earlier i used normal html forms. eg...<form name="customize" method="post" onsubmit="checkSubmit()">

then when i insert any struts <html:...> tags (for example <html:text> in to that form it dosnt display.or error is given.

but if i change the normal form in to struts form the problom solved.
it displays without problom.
but whan i use struts forms i can use only one action for a form.

but still i need a way to use normal html forms.
beause then i can only use more than one action in a form.

i need a way to handle multiple actions within a one form (normal html form)and use struts tags .not struts forms.

help me...


................................................................
if you use normal form instead of struts forms u can see that...
................................................................
<%@ page language="java" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>NewCVPage</title>
<style type="text/css">
<!--
body {
background-image: url(Nback.jpg);
}
-->
<!--
#list {height: 380px; width: 900px; overflow: auto}
-->
</style>
<link href="ARS.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {font-size: 18px}
-->
</style>
</head>

<body >
<%
java.util.Date date = new java.util.Date();
%>

<span class="ARS style2">
<div align="center">
<span class="ARS style2">New CV's</span></span><table width="1000" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="867" height="63"> </td>
<td colspan="2" valign="top"><div id="Layer1" class="ARS" style="position:absolute; left:761px; top:12px; width:237px; height:79px; z-index:1">
<p>Login As: [Cordinator]</p>
<p align="right">[
<html:link page="/Links.do">Home</html:link>
] [
<html:link page="">LogOff</html:link>
] </p>
</div> <p> </p>
<p> </p></td>
<td width="7"></td>
</tr>
<tr>
<td height="44"></td>
<td width="13"></td>
<td width="113"></td>
<td></td>
</tr>
<tr>
<td height="582" colspan="2" valign="top">

<html:form action="NewCvPage.do"> <!--change to ...<form name=..... to see the problom -->

<p class="ARS">
<label> Select Candidates By,
<html:radio property="optDateOrName" value="Date"/>
Date</label>
<label>
<html:radio property="optDateOrName" value="Name"/>
Name</label>
<label>
<html:radio property="optDateOrName" value="All"/>
All</label>
<html:text property="txtSearch" size="20"/><font color="#FF0000"><html:errors/></font>
<html:submit property="btnSend" ><bean:message key="button.search"/></html:submit>
<br>
</p>
</html:form>
<div ID="list">
<table width="823" border="1">
<!--DWLayoutTable-->
<tr bgcolor="#CCCCCC" class="ARS">
<th width="72" height="42" valign="top" scope="col">Candidate name </th>
<th width="99" valign="top" scope="col">Date Posted </th>
<th width="73" valign="top" scope="col">Select Track </th>
<th width="127" valign="top" scope="col">Select Short Lister </th>
<th width="102" valign="top" scope="col">Return Date </th>
</tr>

<html:form action="NewCvPage.do">
<logic:iterate id="cvs" name="newCvPageForm" property="newCV" indexId="indexID">
<tr class="ARS">
<td height="35" valign="top"><a href="Cvtest.doc">
<html:checkbox property="chkNewCv"/><bean:write name="cvs" property="candidateName"/>
</a><bean:write name="indexID"/>
 </td>
<td valign="top"><bean:write name="cvs" property="datePosted"/></td>
<td valign="top"><html:select indexed="true" name="newCvPageForm" property="selTrack">
<html ption value="a">
TR-1</html ption>
<html ption value="b">
TR-2</html ption>
<html ption value="c">
TR-3</html ption>
</html:select></td>
<td valign="top"><html:select indexed="true" name="newCvPageForm" property="selShortList">
<html ption value="a">SL-1</html ption>
<html ption value="b">SL-2</html ption>
<html ption value="c">SL-3</html ption>
</html:select></td>
<td valign="top"><html:text indexed="true" property="txtReturnDate"/></td>

</tr></logic:iterate>
<html:submit property="btnSend"><bean:message key="button.sendtosl"/></html:submit>
<html:submit property="btnSend" ><bean:message key="button.sendtohold"/></html:submit>
</html:form>
</table>
</div>
</body>
</html>
20 years ago
hi...
IN MY STRUTS PROJECT................

i used struts html forms with multiple buttons each should trigger different methods..but same action.

how do i seperately identify which button was clicked and excute appropriate method.

it is better to have a way to identify them using java script.
passing parameter or something like that.
20 years ago
Hi
For my STRUTS PROJECT....I have to connect to a database using DAOs.
I used two layerse called DAO (data access objects) and "service" layer where business logic is reside.i used DTO (datatarnsfer objects) for transfer data from frountend to backend.

later i add another layer between frount and service layer called delegate layer to redue coupling.

Actions-->delegate--> service-->DAO

my problom is what kind of methods i have to use in these layerse.
do i have to use more specific methods at delegate layer, and fewer and 'more general' ones at the DAO or othr way round?
20 years ago
JSP